@tpp/simple-uuid
v1.0.0
Published
A fast, zero dependency uuid generator that works everywhere
Downloads
91
Readme
Simple UUID
This is a simple UUID generator that has zero dependencies and works everywhere.
Usage
Install it first:
$> npm i @tpp/simple-uuid
Then use it to generate a simple and unique id:
let uuid = require('@tpp/simple-uuid')
uuid()
// '3insalcl'
uuid(100)
//'mw8kcgh739zhjs5g2lujpiv1ey2jv8onr4olzvgxishd8k6vv6fm8bycvixlbux4651qg8vxt26srcnxbw08sexutbir5rjbnwko'
It detects NodeJS’s crypto module, or the browsers crypto functionality where available and falls back to Math.random if needed.