1--TEST-- 2mcrypt_create_iv https://bugs.php.net/bug.php?id=55169 3--CREDIT-- 4Ryan Biesemeyer <ryan@yaauie.com> 5--SKIPIF-- 6<?php if (!extension_loaded("mcrypt")) print "skip"; ?> 7--FILE-- 8<?php 9for( $i=1; $i<=64; $i = $i*2 ){ 10 echo 'Input: '. $i . PHP_EOL; 11 $random = mcrypt_create_iv( $i, MCRYPT_DEV_URANDOM ); 12 echo ' Length: ' . strlen( $random ) . PHP_EOL; 13 echo ' Hex: '. bin2hex( $random ) . PHP_EOL; 14 echo PHP_EOL; 15} 16?> 17--EXPECTF-- 18Input: 1 19 Length: 1 20 Hex: %x 21 22Input: 2 23 Length: 2 24 Hex: %x 25 26Input: 4 27 Length: 4 28 Hex: %x 29 30Input: 8 31 Length: 8 32 Hex: %x 33 34Input: 16 35 Length: 16 36 Hex: %x 37 38Input: 32 39 Length: 32 40 Hex: %x 41 42Input: 64 43 Length: 64 44 Hex: %x 45