short-animal-id
v3.0.2
Published
Generates short ids with animal name prefixes
Downloads
31
Readme
short-animal-id
Generates short ids with animal name prefixes. This strives for easily pronunciable and short IDs.
NOTE: This package is not cryptographically random, nor are IDs guaranteed to be unique.
Import
import idGenerators from "short-animal-id";
let { animalId, numericId, alphanumericId } = idGenerators;
Examples
Example adding multiple ids together
console.log(`${animalId()}${numericId()}_${alphanumericId(4, true)}`);
/**
Crane0_P06H
Sandpiper3_6Xzs
Squid6_uPFL
Turkey8_ndIG
Pheasant4_Jdm6
*/
API
animalId()
animalId();
/**
Grouse
Oryx
Raven
Squid
Dinosaur
*/
numericId(length)
length (1 by default)
numericId(6);
/**
734254
408672
211560
044299
714564
*/
alphanumericId(length, includeUppercase)
length (1 by default)
includeUppercase (false by default)
alphanumericId(4);
/**
vh1o
h361
fbbh
gm5i
tc64
*/