Mir kommt auf die schnelle noch sowas in den Sinn:

$hash = base64(deflate($string))