PHP hash function

from PHP Manual Masterpieces, via Rob Pike