3.0.2 • Published 3 years ago

short-animal-id v3.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

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
*/
3.0.2

3 years ago

3.0.1

4 years ago

3.0.0

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago