Closed tomByrer closed 6 years ago
I would love to see crypto.randomBytes
being used, it's the only thing keeping me from loving this library and using it today.
I'd like to see it implemented as well, I'd take a pr if someone wants to give it a go.
Nice wrapper, but should we worry about in-browser usage @jonschlinkert ? https://github.com/crypto-utils/random-bytes
We should try to address it at least. I think there is a browserify plugin for crypto, but I haven't looked at it, no idea if it's a viable solution for this. that does look like a nice wrapper
btw, if someone wants to propose a PR I'd be happy to consider one. Please start with an issue to discuss the algorithm, thanks!
Shouldn't use built in JS Math.random() since it will repeat itself; too dangerous to use for 'Unique ID' etc. https://medium.com/@betable/tifu-by-using-math-random-f1c308c4fd9d#.uskhjv9vc
Might be a while before I can even copy/paste & quick test a solution from there, let alone add the 'white noise' & other repeating tests.
tr;dr: "use urandom. In browser you can use crypto.getRandomValues()" I'm not sure if V8's
crypto.getRandomValues()
can be exposed in node; seems to have its own crypto lib. But node does have crypto.randomBytes(size[, callback])