uuid-random
Generate random UUIDs
with better statistical dispersion
than Math.random()
.
Install
npm install uuid-random
Features
- 0.3k minified + gzipped
- Uses best RNG available to minimize collisions
- Works in browser or server-side
Example Usage
Node
var uuid = require('uuid-random');
uuid();
Browser
<script src="uuid-random.min.js"></script>
<script>
uuid();
</script>
Rationale
Math.random()
sucks for uuid generation.
After digging through npm and
stackoverflow,
I settled on using node-uuid to take
advantage of better RNG when possible.
However, I am a fan of simplicity, so I researched
a much more compact version that still used the best RNG available.
License
MIT