Changelog - 2026-08-18
OpaqueUidHelper
New FeatureIn one line. @venizia/ignis-helpers gained a second ID generator, for IDs a person reads, types, or reads out loud.
What changed
OpaqueUidHelpermints short IDs. Six characters by default, from Crockford's base32 (uppercase, withoutI,L,OandU).- Prefix and delimiter are independent toggles,
{ enable, value }each.INV-7K2MQ9,INV7K2MQ9and7K2MQ9are all configurations of the same helper. - Four alphabets ship with it.
CROCKFORD(32),BASE58(58),NO_VOWEL(50, so no word can form),BASE62(62). nextId()accepts an availability check. Returntrueto accept the drawn ID,falseto draw another. A synchronous check keepsnextId()returning a string; an asynchronous one makes it a promise.- It draws from
crypto.getRandomValues, which works outside a secure context, so it runs on a plain-http origin and inside a browser Worker.
| Helper | parseId() reads back | Pick it when |
|---|---|---|
SnowflakeUidHelper | The exact millisecond, and the worker | The ID is a primary key and you want insert order for free |
OpaqueUidHelper | Nothing | The ID leaves your system |
Who is affected
- Existing applications. No action needed.
SnowflakeUidHelperis untouched. - Anyone printing an ID where a customer sees it. An invoice number built from a Snowflake ID tells the reader the millisecond you issued it.
OpaqueUidHelperdoes not.
Details
Six Crockford characters is 2^30 combinations.
WARNING
At six characters, a 1% chance of at least one collision arrives at roughly 4,600 IDs in one space, and 50% at roughly 38,000. This generator is probabilistic, and no length changes that.
A prefix partitions the space (INV-7K2MQ9 cannot collide with CUS-7K2MQ9), so give each entity type its own. It does not make an ID unique inside that space. Put the column behind a unique index, and regenerate on the violation rather than checking first, which races.
See UID for the full options, the alphabets, and a worked retry example.