- const randomPositiveFloat = crypto.randomBytes(4).readUInt32LE() / 0xffffffff;
- const sign = negative && randomPositiveFloat < 0.5 ? -1 : 1;
- return sign * (randomPositiveFloat * (max - min) + min);
- }
-
- public static getRandomInteger(max = Number.MAX_SAFE_INTEGER, min = 0): number {
- if (max < min || max < 0 || min < 0) {