From 5d79a96856d63f2aea0dd67c23e140d57156724d Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Wed, 2 Apr 2014 11:39:33 +0900 Subject: [PATCH] Add _sha1_short function to Basic class. Currently calls crc32b. Will later return 9 char long sha1 from string given. Will be used for the upcomging crc32b->sha1 switch in projects depending on this class system. --- www/libs/Class.Basic.inc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/www/libs/Class.Basic.inc b/www/libs/Class.Basic.inc index a72fc23d..ef2a1efd 100644 --- a/www/libs/Class.Basic.inc +++ b/www/libs/Class.Basic.inc @@ -1330,6 +1330,16 @@ return $string; } + // METHOD: _sha1_short + // PARAMS: string + // RETURN: sha1 short (9 chars), but current calls _crc32b + // DESC : replacement for _crc32b call + public function _sha1_short($string) + { +// return substr(hash('sha1', $string), 0, 9); + return $this->_crc32b($string); + } + // METHOD: checkPHPVersion // PARAMS: $min_version: minimum version. in format x, x.y or x.y.z // $max_version: default empty, else in same format as min version