Comments (5)
IIRC, the idea of using browser crypto is to allow good seeding without flatten. We should figure out how to make this work under browserify if it's not.
from seedrandom.
it definitely works in the browser. I'm pretty sure these are just warning.
I guess my question is, what is flatten doing? is it coming up with a unique "fingerprint" for a seed based on the window object?
from seedrandom.
The idea is that if you ask for an auto seed, then it tries to generate a seed that is hard to anticipate.
On a browser with a crypto object, this is done using crypto.getRandomBytes().
But when that is not available, "flatten" does its best to collect as much local entropy as it reasonably can by traversing all visible state up to 3 levels deep in the window object, which captures entropy from the website, user, computer, and browser configuration. Unfortunately, that's slow and touches a lot of global variables including deprecated ones that trigger warnings. But it should not be done on a modern browser.
(Flatten is also used to produce a flat string seed from any non-string you might provide as a seed; but I'd expect to see these warnings in the case where flatten is used on a autoseed.)
from seedrandom.
@davidbau yeah it looks like getRandomValues()
has broad support:
http://caniuse.com/#search=getrandomvalues
this might be a great replacement for the flatten()
code (though it could be left as a fallback)
from seedrandom.
strange, the issue seems to have gone away. I've tried both your existing module code and my most recent PR and neither seem to trigger the issue. I'll close this for now. If it happens again I'll re-open with more details.
sorry for the noise!
from seedrandom.
Related Issues (20)
- Unset seedrandom HOT 1
- is it possible to generate a number of 7 digits in length HOT 1
- Question about seeds and collisions HOT 1
- Problem with state HOT 2
- Same seed, different result on different browsers HOT 2
- Is it possible to include this module without extending the Math object? HOT 1
- Strings consisting of a repeated pattern cause collisions HOT 2
- Use of `eval` is unsafe and is disabled on some servers HOT 3
- cannot get it working in angular HOT 1
- document the range or results HOT 1
- inverted Math.round() result HOT 2
- add CHANGELOG file
- Can we get a "latest" url? HOT 1
- NPM package does not provide an ECMAScript module HOT 6
- executing from different computers returns different result HOT 1
- arc4.g in prng function sometimes returns NaN HOT 6
- This package is using eval(); any more modern way to avoid this? HOT 2
- python equivalent? HOT 2
- Is there a way to turn the seedrandom off? HOT 2
- Is there a way to go back steps and repeat them?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from seedrandom.