
Random Strings and Integers That Aren’t - samsk
https://www.endpoint.com/blog/2020/07/02/random-strings-and-integers-that-actually-arent
======
Sharlin
Should be common knowledge, but please avoid using 1, I, l, O, and 0 in codes
such as these.

~~~
brainbag
If you really want to avoid any potential similarities, your character option
of A-Z and 0-9 is even more limited to
"abdfhjkprstuvwxyzACGHJKLMNPQRVWXY3469", according to this research:
[https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3541865/](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3541865/)

~~~
csunbird
The alphabets that are created for nanoid seems to be a valid choice too:
[https://github.com/CyberAP/nanoid-
dictionary](https://github.com/CyberAP/nanoid-dictionary)

------
SloopJon
This post is in the context of a PostgreSQL stored procedure. If you have
ready access to a block cipher, you could use one with an appropriate block
size; e.g., 32-bit RC5 for coupon codes, 128-bit AES for activation keys, or
64-bit Blowfish for something in between.

