PHP provides a simple function can hash in 32bits - hash( $algorithm, $key) - it will provide 8 bytes string as hash result.
$key = "Chun Kang"; echo hash("crc32b", $key);
If you want more secure method, you can add salt like below:
function customHash($key, $salt="Genius") { $key .= $salt; return hash( "crc32b", $key); } $key = "Chun Kang"; echo customHash("crc32b", $key);