paralleldrive / cuid

Collision-resistant ids optimized for horizontal scaling and performance.
Other
3.42k stars 123 forks source link

getRandomValue() should not be able to return 1 exactly #247

Open svanstone-resilient opened 2 years ago

svanstone-resilient commented 2 years ago

Math.random returns from 0 to 1 but shouldn't be able to return 1 exactly. (And this is a crypto replacement for Math.random)