Skip to content

Instantly share code, notes, and snippets.

@jburns131
Created October 16, 2013 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jburns131/7014486 to your computer and use it in GitHub Desktop.
Save jburns131/7014486 to your computer and use it in GitHub Desktop.
<?php
/**
* Create random salt for blowfish crypt hash
*/
$acmsSalt = sprintf('$2y$%02d$', 12).substr(str_replace('+', '.', base64_encode(pack('N4', mt_rand(), mt_rand(), mt_rand(), mt_rand()))), 0, 22).'$';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment