Files
to_docx/client/node_modules/roughjs/bin/math.js
T
Chen Xiao 0b64e2de94 First commit.
Signed-off-by: Chen Xiao <abigwc@gmail.com>
2026-05-08 14:43:16 +08:00

17 lines
364 B
JavaScript

export function randomSeed() {
return Math.floor(Math.random() * 2 ** 31);
}
export class Random {
constructor(seed) {
this.seed = seed;
}
next() {
if (this.seed) {
return ((2 ** 31 - 1) & (this.seed = Math.imul(48271, this.seed))) / 2 ** 31;
}
else {
return Math.random();
}
}
}