0

I want to create a link like http://www.mywebsite/i3DfdgSdec. This link must be unique by registered user in my application. I don't know how to generate a unique ( or with the less error collision probability) on 10 alphanumeric ?

Pracede
  • 4,226
  • 16
  • 65
  • 110
  • Make user name unique and add that name there. – Gibbs Feb 27 '15 at 22:16
  • This url must be shareable on internet. So if the username is visible people could use them to try to login. – Pracede Feb 27 '15 at 22:18
  • Don't you have password – Gibbs Feb 27 '15 at 22:20
  • 2
    create a hash using some common hash algorithm (eg. SHA) and use the first 10 bytes. – qwerty_so Feb 27 '15 at 22:22
  • I cannot provide user's username of my application on internet. I will increase security risk. hackers could use this username and guess password – Pracede Feb 27 '15 at 22:23
  • @ThomasKilian I think i could have collision problem. No ? – Pracede Feb 27 '15 at 22:23
  • @Pracede see http://stackoverflow.com/questions/18134627/how-much-of-a-git-sha-is-generally-considered-necessary-to-uniquely-identify-a – JB Nizet Feb 27 '15 at 22:32
  • Why don't you use a sequence number to identify all of your users? Using just numbers, that would allow a unique number per people on earth. – JB Nizet Feb 27 '15 at 22:34
  • A collision with a SHA is possible but unlikely. You could hold the used hashes in a table and add additional salt to create a different one. – qwerty_so Feb 27 '15 at 22:35
  • Thank you for all your suggestion. I write a class to generate alpha numeric string. I ensure my self in database to avoid birthday problem – Pracede Feb 27 '15 at 23:53

0 Answers0