mcrypt_mock.php 377 B

1234567891011121314151617
  1. <?php
  2. define('MCRYPT_DEV_URANDOM', 1);
  3. function mcrypt_create_iv($int, $flag)
  4. {
  5. $randomSalt = '';
  6. for($i = 0; $i < 16; ++$i) {
  7. $randomSalt .= base_convert(mt_rand(), 10, 16);
  8. }
  9. // hex2bin requires an even length, pad if necessary
  10. if (strlen($randomSalt) % 2)
  11. {
  12. $randomSalt = '0' . $randomSalt;
  13. }
  14. return hex2bin($randomSalt);
  15. }