diff --git a/lib/random/random.js b/lib/random/random.js index 2844fdf..7ae584d 100644 --- a/lib/random/random.js +++ b/lib/random/random.js @@ -8,9 +8,12 @@ const logger = require('../logging') class random { /** * Must be called before any other methods can be called to initialize MersenneTwister - * @param {number} seed - Value to initialize MersenneTwister + * @param {?number} seed - Value to initialize MersenneTwister */ - static init (seed = new Date().getTime()) { + static init (seed = null) { + if (seed === null) { + seed = new Date().getTime() + } random.twister = new MersenneTwister() random.twister.seed(seed) }