Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously only returned from 0 to 0.5. This removed 2 bits of entropy from the generated cuids.
This is a replacement for Math.random() and as such it should return from 0 to 1 (but never return 1 exactly), therefore lim was also modified.
The returned value now has about 30 to 32 bits of entropy. This is probably enough for this library (it gets truncated to 20 bits later), but you could consider using something like this library:
https://github.com/emilbayes/secure-random-double/blob/master/index.js
Which would allow you to get 51 or 52 bits of entropy into the return value.