A library for generating IDs that are shared verbally or via printed media.
- Order IDs on documents that are printed, e.g. in transportation
- Onine game IDs that are shared via text or verbally in a group, e.g. Among Us game codes
- One-time invite codes
- Does not use ambiguous symbols
- Auto-correct common mistakes (mistype or misheard)
Does not use characters that can be misread as numbers
Letter | Number |
---|---|
T | 7 |
O | 0 |
B | 8 |
I | 1 |
Does not use Q or W, since they are easy to be misheard
Fix function will replace not used chars with their probable origins
Char | Replaced with |
---|---|
T | 7 |
O | 0 |
B | 8 |
I | 1 |
Q | 0 |
const hfid = require('hfid');
// Generate a random ID
var id = hfid.random(6);
// Fixing user input
var fixedId = hfid.fix('ARTBI'); // returns 'AR781'