How to generate a human friendly unique ID in Python?

iamgopal picture iamgopal · Jul 20, 2011 · Viewed 13.2k times · Source

How do I generate a unique ID value that can be easily passed on via phone or email, that can be easily remembered while still not being easily guessable.

I am using database. But as I am giving away the ID to people I do not want it to be bound to a database. I could do something with the unique ID I already have in database, but cannot use it directly, to avoid it being guessable.

I am using Python and have tried using uuid, but uuid is too long to be human readable.

Is there any way to create a human friendly pronounceable ID?

Answer

user177800 picture user177800 · Jul 20, 2011

What you want to do is stitch together syllables to create pronounceable pseudo words. You can create syllables in any language you like to make up words that can be pronounced and communicated but don't actually mean anything.

Here is an article about how one person created human readable UIDs for speaking them phonetically and some of the pitfalls.

Read the above link for just some of the pitfalls you should consider when taking an approach like this.

You could just use a string of alphabetic letters but present them as the NATO phonetic alphabet instead of just the alphabet.