- Changed
dist/
outputs:random-js.js
=>random-js.umd.js
random-js.mjs
=>random-js.esm.js
random-js.min.js
=>random-js.umd.min.js
- Release 2.0.0 (no code changes from 2.0.0-rc5)
- Add sourcemaps
- Improve minified bundle size
- Add
"sideEffects": false
topackage.json
as a hint to Webpack
- Provide a binding for
try
-catch
to help parsing issues #30
- Added
nodeCrypto
engine - Exposed
createEntropy
function, which can be used when seeding a Mersenne Twister - Changed
browserCrypto
to no longer benull
if outside of a browser context, insteadthrow
ing on first use.
- Converted to TypeScript, with type definitions available.
- Using ESNext-style modules (though still available as UMD)
- Changed exports so that they are not available on the
Random
class, but instead in a flat hierarchy. - Switched from jasmine to jest
- Using rollup to package the build
- Changed .travis.yml node versions
- add
getUseCount()
to themt19937
engine, which returns how many requests or discards have occurred.
- the current time is now used in
Random.generateEntropyArray
- removed the optionalDependencies in package.json "benchmark" and "microtime".
sample()
results are no longer biased toward the final element.discard(count)
on themt19937
engine properly works when count is less than 625- Clarify that the built-in engines return signed 32-bit integers (not unsigned).
string('')
now throws an errorhex(upper)
now returns a cached function, for efficiency.- add
int32()
, which returns an integer from-0x80000000
to0x7fffffff
. - performance enhancements
- add benchmark suite, covers engines, integer, bool, and real.
- add
date(start, end)
, which returns a Date within a uniform distribution.
Random
no longer needs to be called with new, allowingvar r = require('random-js')()
- Add
begin
andend
arguments topick
andpicker
.
- Even if
shuffle
receives an empty array, it should return that same array.
- Fix
sample
andshuffle
when they are passed an empty array. - Include
-c
(compress) option when uglifying.
Initial release