Comparing version 1.1.1 to 1.2.0
{ | ||
"name": "xorshift", | ||
"description": "Random number generator using xorshift128+", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"author": "Andreas Madsen <amwebdk@gmail.com>", | ||
@@ -14,3 +14,3 @@ "contributors": [ | ||
}, | ||
"repository" : { | ||
"repository": { | ||
"type": "git", | ||
@@ -17,0 +17,0 @@ "url": "git://github.com/AndreasMadsen/xorshift.git" |
@@ -1,2 +0,2 @@ | ||
#xorshift [![Build Status](https://travis-ci.org/AndreasMadsen/xorshift.svg?branch=master)](https://travis-ci.org/AndreasMadsen/xorshift) | ||
# xorshift [![Build Status](https://travis-ci.org/AndreasMadsen/xorshift.svg?branch=master)](https://travis-ci.org/AndreasMadsen/xorshift) | ||
@@ -86,2 +86,9 @@ > Pseudorandom number generator using [xorshift128+](http://xorshift.di.unimi.it/) | ||
The constructor can also be accessed as `require('xorshift').XorShift`, which | ||
is useful when using the `import` syntax. | ||
```javascript | ||
import { XorShift } from 'xorshift' | ||
``` | ||
## Reference | ||
@@ -112,3 +119,3 @@ | ||
##License | ||
## License | ||
@@ -115,0 +122,0 @@ **This software is licensed under "MIT"** |
@@ -123,1 +123,6 @@ | ||
}); | ||
test('constructor export', function (t) { | ||
t.equal(xorshift.constructor, xorshift.XorShift); | ||
t.end(); | ||
}); |
@@ -39,4 +39,4 @@ | ||
var sumL = (s0L >>> 0) + (s1L >>> 0); | ||
resU = (s0U + s1U + (sumL / 2 >>> 31)) >>> 0; | ||
resL = sumL >>> 0; | ||
var resU = (s0U + s1U + (sumL / 2 >>> 31)) >>> 0; | ||
var resL = sumL >>> 0; | ||
@@ -112,1 +112,5 @@ // s[0] = s0 | ||
]); | ||
// Export constructor under its own name so that consumers using ES2015 | ||
// can write `import { XorShift } from 'xorshift'`. | ||
module.exports.XorShift = XorShift; |
26329
625
141
9