File size: 507 Bytes
96af7c9
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
"use strict";
exports.__esModule = true;
exports.unsafeUniformIntDistributionInternal = void 0;
function unsafeUniformIntDistributionInternal(rangeSize, rng) {
    var MaxAllowed = rangeSize > 2 ? ~~(0x100000000 / rangeSize) * rangeSize : 0x100000000;
    var deltaV = rng.unsafeNext() + 0x80000000;
    while (deltaV >= MaxAllowed) {
        deltaV = rng.unsafeNext() + 0x80000000;
    }
    return deltaV % rangeSize;
}
exports.unsafeUniformIntDistributionInternal = unsafeUniformIntDistributionInternal;