Skip to content

Commit

Permalink
fix sfc32
Browse files Browse the repository at this point in the history
  • Loading branch information
bryc committed Aug 31, 2018
1 parent a1fec62 commit dcf6d6c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions jshash/PRNG.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,12 @@ Yet another chaotic PRNG, the sfc stands for "Small Fast Counter". It passes Pra
```js
function sfc32(a, b, c, d) {
return function() {
a >>>= 0; b >>>= 0; c >>>= 0; d >>>= 0;
var t = (a + b) | 0;
a |= 0; b |= 0; c |= 0; d |= 0;
var t = (a + b | 0) + d | 0;
d = d + 1 | 0;
a = b ^ b >>> 9;
b = c + (c << 3) | 0;
c = (c << 21 | c >>> 11);
d = d + 1 | 0;
t = t + d | 0;
c = c << 21 | c >>> 11;
c = c + t | 0;
return (t >>> 0) / 4294967296;
}
Expand Down

0 comments on commit dcf6d6c

Please sign in to comment.