looking for an algorithm that when given a First and a last name, an id is generated such that it consists of purely alphanumeric characters. Also, I would want this to be as short as possible whilst maintaining uniqueness. I was hoping for around 10-12 characters - something that a human could enter.
I have read about suggestions of computing a hash, then simply taking the first n bytes and calling modulus with 36 (the idea is that you have a mapping from 0-35 to the letters a-z 0-9).
Also heard suggestions of maybe truncating and using a higher base to pack more bits into the id.
I guess I could append some encoding of the generation time to the produced id to make it unique but again I need a way for this to be short.
What's your opinion? Are there specific hashing algorithms/truncating methods I should go for? I'll be implementing it in javascript as part of a static html page used as a local webapp.
I am just worried as crypto is hard and I would welcome advice from anyone who thinks they know what they are doing with it.
If it helps the number of ids I expect to make is small - around 4 digits.