1.0.0 • Published 4 years ago

@tpp/simple-uuid v1.0.0

Weekly downloads
8
License
ISC
Repository
github
Last release
4 years ago

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.