Skip to content

Latest commit

 

History

History
18 lines (13 loc) · 537 Bytes

README.md

File metadata and controls

18 lines (13 loc) · 537 Bytes

A (so far quite naive) implementation of NanoID in the Jai programming language.

Usage

NOTE: Before you generate NanoIDs with this library, you must initialize your random seed. We provide a helpful utility function for this:

nanoid_initialize_random();

... but obviously, if you do this elsewhere in your program, it is not necessary.

To generate an ID, simply call:

myid := nanoid_generate();

You can optionally pass alphabet and size parameters to control the alphabet and size.