Created
April 26, 2014 16:19
-
-
Save marydn/11324213 to your computer and use it in GitHub Desktop.
Generate token
This file contains 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 | |
// 32-byte length | |
$token = md5(uniqid(mt_rand(), true)); | |
// 256 | |
$token = bin2hex(mcrypt_create_iv(128, MCRYPT_DEV_RANDOM)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment