print "Created GUID 3: " . GUID::create() . "<br/><br/>\n"; /** * Test ROT13 encoding. */ $rot13enc = ROT13::encode($input); $rot13dec = ROT13::decode($rot13enc); // print "ROT13 encoded in UTF-8: " . $rot13enc . "<br/>\n"; print "ROT13 decoded in UTF-8: " . $rot13dec . "<br/><br/>\n"; /** * Test MD5 with one official test vector and custom input. * Vectors from: http://www.febooti.com/products/filetweak/members/hash-and-crc/test-vectors/ */ $md5 = MD5::compute($input); $md5tv = MD5::compute(""); $md5hmac = MD5::computeHMAC("1234567890123456", $input); // print "MD5 from otv is ok: " . bool_str(Base16::encode($md5tv) == "d41d8cd98f00b204e9800998ecf8427e") . "<br/>\n"; print "MD5 HMAC in UTF-8: " . Base16::encode($md5hmac) . "<br/>\n"; print "MD5 in UTF-8: " . Base16::encode($md5) . "<br/><br/>\n"; /** * Test RIPEMD-160 with one official test vector and custom input. * 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";