Documentation
¶
Overview ¶
Package pairingcode generates and validates short, human-readable codes — the kind a person reads off one screen and types on another (device pairing, invitation links). Codes use a Crockford-style alphabet with the visually ambiguous characters removed.
Index ¶
Constants ¶
const ( DeviceCodeLength = 8 InviteCodeLength = 12 )
Canonical code lengths. Device pairing keeps 8 (~2^39, paired with a short TTL and per-IP rate limit); invitation codes use 12 (~2^59) because their link lives for days.
const Alphabet = "23456789ABCDEFGHJKMNPQRSTVWXYZ"
Alphabet is a Crockford-style alphabet with the visually ambiguous characters removed (no 0/O, 1/I/L, or U), so a human can read a code off one screen and type it on another without confusion. 30 characters.
Variables ¶
This section is empty.
Functions ¶
func IsValid ¶
IsValid reports whether code is a well-formed canonical code (right length, only alphabet characters). Callers should Normalize first.
Types ¶
This section is empty.