Tuesday, May 21, 2024
 Popular · Latest · Hot · Upcoming
93
rated 0 times [  98] [ 5]  / answers: 1 / hits: 91926  / 13 Years ago, fri, december 16, 2011, 12:00:00

I want to create a random string (token) which can be used to identify a user whilst avoiding any potential conflicts with any other users' tokens.



What I was thinking of was an MD5 hash of navigator.userAgent + new Date().getTime() to generate the token but that requires a whole Javascript MD5 library to hash it which I don't really want to do.



It has to be made up of A-Z/0-9 characters and ideally no longer than 32 characters. I am open to all ideas. Thanks!



Just to clarify I'm not looking for any random string generator, the random string has to be generated from the users details available through Javascript and can also use time to avoid potential conflicts!


More From » jquery

 Answers
17

Checkout crypto.js project. Its a collection of cryptographic algorithms. The project has separate js files for each hashing algorithms.


[#88528] Wednesday, December 14, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lailab

Total Points: 706
Total Questions: 102
Total Answers: 95

Location: Falkland Islands
Member since Mon, Jul 13, 2020
4 Years ago
;