Add override string for sha1 short function to use sha1 instead of crc32b wrapper

This commit is contained in:
Clemens Schwaighofer
2015-11-06 16:53:55 +09:00
parent ae1ef182ef
commit b831924f58

View File

@@ -1386,13 +1386,15 @@
} }
// METHOD: _sha1_short // METHOD: _sha1_short
// PARAMS: string // PARAMS: string, flag to use sha
// RETURN: sha1 short (9 chars), but current calls _crc32b // RETURN: sha1 short (9 chars), but current calls _crc32b
// DESC : replacement for _crc32b call // DESC : replacement for _crc32b call
public function _sha1_short($string) public function _sha1_short($string, $use_sha = false)
{ {
// return substr(hash('sha1', $string), 0, 9); if ($use_sha)
return $this->_crc32b($string); return substr(hash('sha1', $string), 0, 9);
else
return $this->_crc32b($string);
} }
// METHOD: checkPHPVersion // METHOD: checkPHPVersion