4 ms·
Huh, interesting. For stuff like this (human-friendly numbers/ids/codes) I tend to use google's base20 Open Location Code alphabet[0] that I read an explanation
by coolreader18 6y ago
Huh, interesting. For stuff like this (human-friendly numbers/ids/codes) I tend to use google's base20 Open Location Code alphabet[0] that I read an explanation of a long time ago on their website[1] :P. Whereas this project aliases some similar letters together, the OLC alphabet avoids similar looking letters altogether and tries to avoid spelling any words at all. Keep in mind that "oh, letters are aliases for each other" doesn't necessarily help now that "passwords are case sensitive" is also drilled into users' heads, and no distinction between I/l is even more rare than case sensitivity, so users might unnecessarily remember the difference or make a fuss about it (speaking from experience working with my grandmother and technology).
Anyway, usually I just copy/paste a piece of code like below to use the OLC alphabet and randomly generate an id, and you could just copy the literal to use as a radix alphabet as well.
"".join(random.choices("23456789CFGHJMPQRVWX", k=5))
# check against id in dict
if userinput.toupper() in idmapping: ...
[0]: https://github.com/google/open-location-code/blob/master/js/src/openlocationcode.js#L100 https://github.com/google/open-location-code/blob/master/js/...
[1]: https://github.com/google/open-location-code/blob/master/docs/olc_definition.adoc#introduction https://github.com/google/open-location-code/blob/master/doc..., under "Easy to use"