I am trying to create a 'confirmation code' for every user account created on my website and storing it in the db along with their personal information. As you can see in the example below, I tried to generate a random string factoring in the time variable, however, the string is unneccessarily long.
I would like the string to be shorter than the one produced by md5
I was wondering if there is a relatively easy way to generate 10 digit (max) alphanumeric string that has an extremely low collision rate?
What I tried:
md5(mt_rand(10000,99999).time() . 'example@domain.com');
Output:
0dd6854dba19e70cfda0ab91595e0376