Hiya, What’s the best way of generating a unique key, that can’t be guessed easily? I would like to create a unique key for both account activation and referral purposes, that includes a check-sum to help prevent users from easily guessing other users activation or referral keys. Any help is greatly appreciated. Many Thanks, FishSword
Im interested in the same thing, but passing a password that would generate the key. Example, I pass the word "beta" to the PHP and it would generate a unique key of lets say 100 characters. If you pass something else it generates other random garbage, but if you pass the same word "beta" again it generates exactly the same key. I saw this before but just cannot remember where. Basically I need to create a unique key on disc.
to create a unique key you can combine a number of things: //Salt can be anything the more often it changes the better $salt = "some-string"; //Generates a random string using the clock and add the salt as a prefix to the random sting $randomstring = uniqueid($salt); //Hash the random string using sha1 $uniquekey = sha1($randomstring); PHP: