Archive - Jan 6, 2007 - Blog entry

Date

How many hash PHP 5 have built in support?

Apart form common md5() and sha1(), there are other ones exist, try this:

it will output all the hashes supported by PHP. Then you can use the value in that array with the hash function.
For example:

hash("haval128,3", 'Mgccl is the best');
//returns haval128,3 hashed string, which is 3324137218b4d7686e99454d7ea66651

Here is a small function I wrote to get a string hashed by all hash method in PHP

function all_hash($string){
	$hash = hash_algos();
	foreach($hash as $var){
		$result[$var] = hash($var, $string);
	}
	return $result;
}
print_r(all_hash('Mgccl'));
Honey Pot that kill bots