Closed tremby closed 10 years ago
I agree; null and undefined should work the same as omitting the argument.
I'll soon look at releasing a version 2.3 based on this: http://davidbau.com/encode/seedrandom-test.js
The idea will be to (1) fix the two reported issues; and (2) also not crash when autoseeding within the node.js environment.
Let me know if you notice any issues with the draft new version above.
Fixed in version 2.3. You can pass null as the first argument to autoseed.
Instead of being able to do
where I might want it to be randomly seeded, but in a special case I want a particular seed, I currently need to write
I had expected
undefined
to work the same way as no argument at all, but it is being converted to a stringundefined\0
. Maybenull
should work the same way too.The second code sample isn't much more complicated, I concede, but the first is more concise and I fully expected it to work.