/** * md5 integer hash * Using 7 instead of 8 just because that makes the integers lower than * 32 bit (28 bit) and so they do not interfere with UNSIGNED integers * or PHP-versions which has varying output from the hexdec function. * * @param string $str String to hash * @return integer Integer intepretation of the md5 hash of input string. */ protected function md5inthash($str) { return \TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::md5inthash($str); }
/** * Get search hash, external files * * @param string $file File name / path which identifies it on the server * @param array $subinfo Additional content identifying the (subpart of) content. For instance; PDF files are divided into groups of pages for indexing. * @return array Array with "phash_grouping" and "phash" inside. */ public function setExtHashes($file, $subinfo = array()) { // Set main array: $hash = array(); $hArray = array('file' => $file); // Set grouping hash: $hash['phash_grouping'] = IndexedSearchUtility::md5inthash(serialize($hArray)); // Add subinfo $hArray['subinfo'] = $subinfo; $hash['phash'] = IndexedSearchUtility::md5inthash(serialize($hArray)); return $hash; }
/** * Search for one distinct word * * @param string $sWord Word to search for * @return pointer SQL result pointer * @todo Define visibility */ public function searchDistinct($sWord) { $wSel = 'IW.wid=' . \TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::md5inthash($sWord); $res = $this->execPHashListQuery($wSel, ' AND is_stopword=0'); return $res; }
/** * md5 integer hash * Using 7 instead of 8 just because that makes the integers lower than * 32 bit (28 bit) and so they do not interfere with UNSIGNED integers * or PHP-versions which has varying output from the hexdec function. * * @param string $str String to hash * @return int Integer intepretation of the md5 hash of input string. */ protected function md5inthash($str) { return Utility\IndexedSearchUtility::md5inthash($str); }