2:53 · recorded · Watch on YouTube (number 9 in the series) · Transcript

Transcript

HardGuard25 gives us a readable reference for the codes we have to read, type, print, or say aloud, alongside the database key.

The pattern is simple. We keep the database key, put a separate reference on a receipt or label, and normalize entry before lookup. Support can use that reference to find the original record.

The browser generator makes the idea tangible. Here, eight character payloads are grouped in fours. Generate uses local browser randomness. The results can be copied onto a label or into a support workflow, without a sign in.

Sam originally designed this alphabet in twenty fourteen, then refined and published it in twenty nineteen, while explaining course coding in learning management systems. By March of twenty twenty-six, the public repository brought the specification and reference libraries together. The idea began with codes people actually handled.

The alphabet keeps ten digits and fifteen letters. When a letter competes with a digit, the digit wins. Zero is included; the letter O isn't. That's an exclusion policy, not a measured promise of fewer transcription errors.

Normalization handles the handoff. Lowercase input and display hyphens become the canonical uppercase value. Validation accepts the grouped example, and rejects the letter O. The library doesn't silently turn an ambiguous letter into a digit.

Applications own the rest: enough random characters for the issuance volume, a uniqueness check with collision retry, and access control. The optional check digit catches some entry errors. It isn't authentication, and it adds no random entropy.

Version one point four point zero is the frozen reference, with JavaScript, Python and Go implementations and shared conformance vectors. The specification is openly licensed, and the code is MIT.

The project is complete for its intended scope. Development is frozen, and the GitHub repository is archived. The specification, packages, documentation and local generator are available for use, without an ongoing security or compatibility support commitment.

A small alphabet, an explicit specification, and working tools for the reference codes people handle. HardGuard25 is a completed public reference. For the record.

Reference codes people handle.

HardGuard25 is a 25-character alphabet for codes we read from receipts, enter from labels, or say to support.

Keep the database ID; add a human-facing reference. Store ACDF0G7HJ2KMNP3R, display ACDF-0G7H-J2KM-NP3R, and normalize entry before lookup. Enforce uniqueness and keep access controls in the application.

Adopt an alias beside an existing UUID or database key, or use the Nano ID custom-alphabet recipe.

Project record

The project is complete for its intended scope, with development frozen at reference version 1.4.0. The alphabet, specification, conformance vectors and reference implementations are available for use under their existing licenses. The public GitHub repository is archived.

Harnessie vendors the alphabet and checksum for run and request references. Its vendored copy has a separate lifecycle and no 1.4.0 conformance claim; see the adoption record and compatibility boundary.

Crockford Base32 also targets human reading. HardGuard25 makes different exclusion and decoding choices; comparative human-error improvements remain unmeasured. The alternatives table covers Crockford, UUIDv7, ULID, TypeID and Sqids.

Why these 25 characters?

Standard alphanumerics give you 36 characters (0–9, A–Z). That creates real problems when a human reads, transcribes, or dictates a code out loud. HardGuard25 keeps all ten digits and fifteen carefully chosen letters, removing eleven sources of confusion. Design principle: when a letter and a digit compete for the same visual slot, the digit always wins.

Reduced confusables

Common digit-letter pairs such as O vs 0, I vs 1, S vs 5, and B vs 8 are excluded from printed or dictated identifiers.

Dyslexia-conscious

Ambiguous shapes and mirror-prone pairs, including Q/P and E/3, are excluded because they are relevant to dyslexia-sensitive workflows. Comparative performance has not yet been established.

OCR-conscious

Designed for use with OCR-A, Menlo, and other monospace typefaces on receipts, labels, and printed materials. Comparative OCR performance has not yet been benchmarked.

RemovedReason
OConfusable with 0 (zero)
IConfusable with 1 (one) and lowercase L
LConfusable with 1 (one) and uppercase I
BConfusable with 8; dyslexia mirror pair with D
SConfusable with 5
ZConfusable with 2
EConfusable with 3 for dyslexic readers; digits take priority
QConfusable with O in some typefaces; dyslexia mirror pair with P
VConfusable with U in many typefaces
TResembles a plus sign in some contexts
XCollides with multiplication operator; varies by locale

Entropy and length

Each HardGuard25 character carries log2(25) ≈ 4.64 bits of entropy. Pick a length for your risk profile:

LengthPossible payload stringsSweet spot for
4390,625Small inventory, tickets
6244 millionMedium businesses
8152 billionLarge systems
1259.6 quadrillionInternal identifiers
162.33 × 1022Cross-system identifiers
209.09 × 1027Public lookup identifiers

These values are possible payload strings, not safe random issuance counts. Random issuance must account for birthday collisions. An appended check digit is derived from the payload and does not add random entropy. These lengths apply to lookup identifiers, not bearer or authentication secrets.

Final release: 1.4.0

Frozen reference implementations remain available in JavaScript, Python, and Go. Each includes generation, validation, normalization, and an optional Mod-25 check digit. Eight-character usage examples are demonstrations, not production defaults. Choose length from issuance and collision budget. Node >=22; Python wheels >=3.9 (source builds >=3.10); Go >=1.21. The JavaScript package includes TypeScript declarations. Start with the adoption guide, then use the implementation guide or the assistant guide. The plain-text guide has a SHA-256 sidecar for verification.

JavaScript

Literal

npm install hardguard25@1.4.0

Literal

import { generate, validate, normalize, checkDigit }
  from 'hardguard25';

generate(8);                        // illustrative output: "AC3H7PUW"
generate(8, { checkDigit: true });  // + check char
validate("AC3H-7PUW");              // true
normalize("ac3h-7puw");             // "AC3H7PUW"

Python

Literal

pip install hardguard25==1.4.0

Literal

from hardguard25 import (
  generate, validate, normalize, check_digit,
)

generate(8)                         # illustrative output: "AC3H7PUW"
generate(8, check_digit=True)       # + check char
validate("AC3H-7PUW")               # True
normalize("ac3h-7puw")              # "AC3H7PUW"

Go

Literal

go get github.com/snapsynapse/hardguard25/go@v1.4.0

Literal

import "github.com/snapsynapse/hardguard25/go"

id, _ := hardguard25.Generate(8)
id, _ = hardguard25.GenerateWithCheck(8)
ok := hardguard25.Validate("AC3H-7PUW")
s, _ := hardguard25.Normalize("ac3h-7puw")

No library needed

Reference

# Alphabet
0123456789ACDFGHJKMNPRUWY

# Regex
^[0-9ACDFGHJKMNPRUWY]+$

# Normalization: remove the pinned Unicode White_Space set
# and - _ .; uppercase; reject all other characters.

The alphabet is the standard. If you just need the character set, use it directly.

Retained local generator

The interactive generator produces real HardGuard25 codes in the browser. Pick a length, quantity, grouping, case, and optional check digit.

AC3H–7PUW–K2MN–PR4Y