Add class version of PHP hashing code.