id16: Humanized IDs for URLs and more

id16 is a human-friendly identifier encoding for use in URLs, single-use login codes, or anywhere a short, easy-to-read ID is needed. Examples look like: B2F9, R25J, 9BC7, or 2397.

Unlike standard hexadecimal, id16 uses a carefully chosen 16-character set: ABCFHJKQRUY23579

This set avoids visually confusable characters, such as I, L, O, S, V, Z, digits like 0 and 1, or audibly confusable characters such as D, P, B. This makes IDs easy to read, type, and speak aloud. The alphabet is case-insensitive, simplifying input across devices, including phones, TVs, VR headsets etc.

Key space and entropy
* Each character encodes 4 bits (2^4 = 16).
* With 4 characters, the key space is 16^4 = 65,536 IDs (2^16 bits).
* For shorter IDs, fewer characters can be used (e.g., 3 chars → 12 bits → 4,096 IDs).

This size is suitable for applications where human readability is more important than a large key space.

Use cases

Id16 is ideal for:
* URLs with short human-readable identifiers
* Single-use login codes (SMS, email, or TV display)
* Any situation where IDs must be typed, read, or spoken easily

For larger key spaces, use longer codes. For small-scale applications, short will be enough, which keeps the IDs short and readable.

https://github.com/herbert-van-vliet/id16