2.0.4 • Published 8 months ago

simple-id v2.0.4

Weekly downloads
578
License
MIT
Repository
github
Last release
8 months ago

simple-id

A library for generating short, user-friendly, random IDs.

Install

npm install simple-id

Usage

const simpleId = require("simple-id");
simpleId();

By default, an 8-character random ID is generated using a 31-character alphabet (23456789abcdefghjkmnpqrstuvwxyz) which notably excludes the uppercase letters and 01ilo to avoid ambiguity. This gives about 853 billion possible permutations. A different length and/or alphabet can be passed as follows:

simpleId(9);
simpleId(8, "0123456789abcdef");

Implementation

The implementation uses the cryptographically strong crypto.getRandomValues() function and provides uniformly distributed random IDs. It has no other dependencies.

2.0.3

8 months ago

2.0.2

8 months ago

2.0.4

8 months ago

2.0.1

8 months ago

2.0.0

8 months ago

1.0.1

1 year ago

1.0.0

8 years ago