Merge pull request #51 from onovy/random-pptr-seed

Initialize pptr to pseudo-random place before seeding.
This commit is contained in:
pointbiz 2014-01-09 18:59:43 -08:00
commit b100c39dac
2 changed files with 2 additions and 2 deletions

View file

@ -1634,7 +1634,7 @@ if (typeof Crypto == "undefined" || !Crypto.util) {
sr.pool[sr.pptr++] = t >>> 8;
sr.pool[sr.pptr++] = t & 255;
}
sr.pptr = 0;
sr.pptr = Math.floor(sr.poolSize * Math.random());
sr.seedTime();
// entropy
var entropyStr = "";

View file

@ -147,7 +147,7 @@
sr.pool[sr.pptr++] = t >>> 8;
sr.pool[sr.pptr++] = t & 255;
}
sr.pptr = 0;
sr.pptr = Math.floor(sr.poolSize * Math.random());
sr.seedTime();
// entropy
var entropyStr = "";