Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "xorshift", | ||
"description": "Random number generator using xorshift128+", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"author": "Andreas Madsen <amwebdk@gmail.com>", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -124,16 +124,11 @@ | ||
// There is nothing particularly scientific about this seed, it is just | ||
// based on the clock. | ||
// Seed with Math.random() by default to prevent seed collision | ||
function getRandomSeed() { | ||
return Math.random() * Math.pow(2, 32); | ||
} | ||
module.exports = new XorShift([ | ||
0, Date.now() / 65536, | ||
0, Date.now() % 65536 | ||
getRandomSeed(), | ||
getRandomSeed(), | ||
getRandomSeed(), | ||
getRandomSeed() | ||
]); | ||
// Perform 20 iterations in the RNG, this prevens a short seed from generating | ||
// pseudo predictable number. | ||
(function () { | ||
var rng = module.exports; | ||
for (var i = 0; i < 20; i++) { | ||
rng.randomint(); | ||
} | ||
})(); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
26322
636