rndid
v0.0.2
Published
A package for generating random unique(ish) IDs
Downloads
1
Readme
RNDID
A package for generating random unique(ish) IDs
Installation
$ yarn add rndid
or if your still use npm
$ npm install rndid --save
Usage
let rndid = require('rndid');
// generate a random 32 bit number between 15203654 and 98880000
let num = rndid.randomNumber(15203654, 98880000);
// generate a random hex string of 20 bytes
let hex = rndid.bytes(20, 'hex');
// etc...
API
randomNumber
generate random 32 bit numbers within a certain range
Parameters
randomInt64
generate a random 64 bit integer - returns a string due to JavaScript limitations
bytes
Parameters
ksuid
generate a KSUID
Parameters
seconds
seconds with with which to generate KSUID
uuid
generate UUID v4