<?php $hash_alg = MHASH_TIGER; $message = "These are the directions to the secret fort. Two steps left, three steps right, and cha chacha."; $hashed_message = mhash($hash_alg, $message); print "The hashed message is ". bin2hex($hashed_message); ?> 执行这一段脚本程序将得到下面的输出结果:
The hashed message is 07a92a4db3a4177f19ec9034ae5400eb60d1a9fbb4ade461
<?php $hash_alg = MHASH_TIGER; print "This data has been hashed with the".mhash_get_hash_name($hashed_message)."hashing algorithm."; ?>> 得到的输出是: This data has been hashed with the TIGER hashing algorithm.