Exemplo n.º 1
0
 public function CryptoKit(Benchmark $b)
 {
     for ($i = 0; $i < $b->n; $i++) {
         $h = new HashHMAC(new Hash('md5'), self::KEY, 64);
         $h->update(self::DATA)->sum();
     }
 }
Exemplo n.º 2
0
 public function testHashStream()
 {
     $h = new HashHMAC(new Hash('md5'), self::KEY, 64);
     $expect = hash_hmac_file('md5', __FILE__, self::KEY);
     $f = fopen(__FILE__, 'r');
     $actual = $h->updateStream($f)->sum();
     $this->assertEquals($expect, $actual);
 }