make() public static method

Hash an input string into a salted 512 byte hash.
public static make ( string $input, string $password, integer $cost = 250000 ) : string
$input string Data to hash.
$password string HMAC validation password.
$cost integer Cost value of the hash.
return string
Beispiel #1
0
 public function testFail()
 {
     $input = str_repeat('A', rand(0, 10000));
     $key = str_repeat('A', rand(10, 100));
     $cost = 1;
     $output = Hash::make($input, $key, $cost);
     $this->assertTrue(Hash::verify($input, $output, $key));
     for ($i = 0; $i < 10; $i++) {
         $corrupt = self::swaprandbyte($output);
         $this->assertFalse(Hash::verify($input, $corrupt, $key));
     }
 }