- Using user id, i.e. maxtheman
- Add a secret salt in the beginning and the end of the User ID, for instance,
$preSalt="aloha";
$postSalt="goodbye";
$Token = $preSalt + $UID + $postSalt;
for our example, it is "alohamaxthemangoodbye" - Hash it with md5 (just b/c there is a md5 function everywhere; so, I use it):
md5($Token) that is
md5("alohamaxthemangoodbye") = ee15d0b677a8ed1b25e470fe888958d7 - Then, we chop the word -- any part you like thefirst8letters("ee15d0b677a8ed1b25e470fe888958d7") = ee15d0b6
How do you think?
No comments:
Post a Comment