
A Mojo port of NanoID, a tiny, secure, URL-friendly, unique string ID generator.
README
A Mojo port of NanoID, a tiny, secure, URL-friendly, unique string ID generator.
Add nanoid to your mojoproject.toml dependencies and install with your preferred Mojo package manager.
from nanoid import nanoid
# Generate a default 12-character ID
id = nanoid()
print(id)
# Generate a 21-character ID
id = nanoid[length=21]()
print(id)
# Generate an ID with a custom alphabet
id = nanoid[length=10](alphabet="abcdef123456")
print(id)Run the included test with:
magic run testApache 2.0. See LICENSE for details.
DETAILS