public function generateValidationHash($code) { for ($h = 0, $i = strlen($code) - 1; $i >= 0; --$i) { $h += ord($code[$i]); } return $h; }