
Generates secure, compact, URL-friendly unique string IDs using customizable options such as random number generator, alphabet, and size. Supports cryptographic security and well-tested functionality.
[!IMPORTANT] Read the full documentation on the iNKraft website.
https://datlag.dev/libraries/nanoid/
A Kotlin Multiplatform port of this JavaScript library, providing a fast, secure and URL-friendly unique ID generator.
The following targets are supported:
| Platform | Targets |
|---|---|
| JVM & Android |
jvm, android
|
| Apple |
ios, macos, tvos, watchos
|
| Web |
js, wasmJs
|
| Native & Other |
linux, mingw
|
NanoId comes with several features while beeing fully customizable.
NanoId uses Korlibs Crypto SecureRandom to generate cryptographically strong random IDs with a proper distribution of characters.
Crypto provides a SecureRandom class that extends the kotlin.random.Random class, but generating cryptographic secure values.
SecureRandom on the JVM + PRNGFixes on Android./dev/urandom
BCryptGenRandom is in useNanoId generates compact IDs with just 21 characters.
By using a larger alphabet than UUID, NanoId can generate a greater number of unique IDs, when compared to UUID, with fewer characters (21 vs 36).
NanoId is fully customizable.
All default options may be overridden. Supply your own Random Number Generator, alphabet or size.
[!IMPORTANT] Read the full documentation on the iNKraft website.
https://datlag.dev/libraries/nanoid/
A Kotlin Multiplatform port of this JavaScript library, providing a fast, secure and URL-friendly unique ID generator.
The following targets are supported:
| Platform | Targets |
|---|---|
| JVM & Android |
jvm, android
|
| Apple |
ios, macos, tvos, watchos
|
| Web |
js, wasmJs
|
| Native & Other |
linux, mingw
|
NanoId comes with several features while beeing fully customizable.
NanoId uses Korlibs Crypto SecureRandom to generate cryptographically strong random IDs with a proper distribution of characters.
Crypto provides a SecureRandom class that extends the kotlin.random.Random class, but generating cryptographic secure values.
SecureRandom on the JVM + PRNGFixes on Android./dev/urandom
BCryptGenRandom is in useNanoId generates compact IDs with just 21 characters.
By using a larger alphabet than UUID, NanoId can generate a greater number of unique IDs, when compared to UUID, with fewer characters (21 vs 36).
NanoId is fully customizable.
All default options may be overridden. Supply your own Random Number Generator, alphabet or size.