Exemple #1
0
 /**
  * @dataProvider getByte
  */
 public function testGetFlooredByteSize(MathAdapterInterface $adapter, $x, $expected)
 {
     $size = NumberSize::getFlooredByteSize($adapter, $x);
     $this->assertEquals($expected, $size);
 }
 /**
  * @param int|string $max
  * @return int|string
  */
 public function generate($max)
 {
     $bytes = NumberSize::getFlooredByteSize($this->adapter, $max);
     $iv = mcrypt_create_iv($bytes, \MCRYPT_DEV_URANDOM);
     return $this->adapter->hexDec(bin2hex($iv));
 }