Expand description
Human-friendly pairing code generator.
8 chars from ABCDEFGHJKLMNPQRSTUVWXYZ23456789 (no 0/O/1/I/L),
retried up to 500 times if the generator collides with an
already-active code in the store.
Constants§
Functions§
- generate_
unique - Generate a code that does not collide with any entry in
existing. ReturnsErrafterMAX_ATTEMPTScollisions — caller should surface that as a 5xx-equivalent: the keyspace is large (32^8 ≈ 10^12), so 500 collisions in a row means something else is wrong (e.g. RNG broken). - random