/** * Perform and return a Blowfish hash on the given string. Strength value must be in the range 04-31 * Use this for password hashes. */ public static function hash_blowfish($toHash, $strength = '07') { return crypt($toHash, '$2a$' . str_pad($strength, 2, '0', STR_PAD_LEFT) . '$' . Crypt::rand_alphanumeric(22) . '$'); }