short-animal-id
TypeScript icon, indicating that this package has built-in type declarations

3.0.2 • Public • Published

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

Package Sidebar

Install

npm i short-animal-id

Weekly Downloads

2

Version

3.0.2

License

MIT

Unpacked Size

6.77 kB

Total Files

7

Last publish

Collaborators

  • cktang88