Mudsaf Posted October 1, 2013 Share Posted October 1, 2013 Hello, i'm wondering which is best method to make account recovery key? Wondering is MD5 with random integer from 1-100k + some text there be good? Link to comment Share on other sites More sharing options...
Ingolme Posted October 1, 2013 Share Posted October 1, 2013 Probably using an alphabet and a random set of characters. function generate_key($key_length, $alphabet) { $limit= strlen(alphabet) - 1; $key = ''; for($i = 0; $i < key_length; $i++) { $key .= $alphabet[mt_rand(0, $limit)]; }return $key;}// Generate the key with a particular alphabet$len = 150;$a= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'generate_key($len, $a); Link to comment Share on other sites More sharing options...
Mudsaf Posted October 1, 2013 Author Share Posted October 1, 2013 Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now