Skip to content

Instantly share code, notes, and snippets.

@marydn
Created April 26, 2014 16:19
Show Gist options
  • Save marydn/11324213 to your computer and use it in GitHub Desktop.
Save marydn/11324213 to your computer and use it in GitHub Desktop.
Generate token
<?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