* Vectors from: http://www.febooti.com/products/filetweak/members/hash-and-crc/test-vectors/ */ $rmd160 = RMD160::compute($input); $rmd160tv = RMD160::compute(""); $rmd160hmac = RMD160::computeHMAC("1234567890123456", $input); // print "RIPEMD-160 from otv is ok: " . bool_str(Base16::encode($rmd160tv) == "9c1185a5c5e9fc54612808977ee8f548b2258d31") . "<br/>\n"; print "RIPEMD-160 HMAC in UTF-8: " . Base16::encode($rmd160hmac) . "<br/>\n"; print "RIPEMD-160 in UTF-8: " . Base16::encode($rmd160) . "<br/><br/>\n"; /** * Test SHA-1 with one official test vector and custom input. * Vectors from: http://www.febooti.com/products/filetweak/members/hash-and-crc/test-vectors/ */ $sha1 = SHA1::compute($input); $sha1tv = SHA1::compute(""); $sha1hmac = SHA1::computeHMAC("1234567890123456", $input); // print "SHA-1 from otv is ok: " . bool_str(Base16::encode($sha1tv) == "da39a3ee5e6b4b0d3255bfef95601890afd80709") . "<br/>\n"; print "SHA-1 HMAC in UTF-8: " . Base16::encode($sha1hmac) . "<br/>\n"; print "SHA-1 in UTF-8: " . Base16::encode($sha1) . "<br/><br/>\n"; /** * Test SHA-256 with one official test vector and custom input. * Vectors from: http://www.febooti.com/products/filetweak/members/hash-and-crc/test-vectors/ */ $sha256 = SHA256::compute($input); $sha256tv = SHA256::compute(""); $sha256hmac = SHA256::computeHMAC("1234567890123456", $input); // print "SHA-256 from otv is ok: " . bool_str(Base16::encode($sha256tv) == "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855") . "<br/>\n"; print "SHA-256 HMAC in UTF-8: " . Base16::encode($sha256hmac) . "<br/>\n"; print "SHA-256 in UTF-8: " . Base16::encode($sha256) . "<br/><br/>\n";