Created
January 23, 2012 16:26
-
-
Save samrdev/1664094 to your computer and use it in GitHub Desktop.
Create a unique 10-place user id.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function createId($mail, $token) { | |
$r = range('a', 'f'); | |
$h = md5($mail.$token); | |
$i = str_replace($r, '', strtolower($h)); | |
$i = substr($i, 0, 10); | |
return (string)$i; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment