*/
protected function cacheCodesCallback($matches) {
// create hash
- $hash = '@@'.StringUtil::getHash(uniqid(microtime()).$matches[3]).'@@';
+ $hash = '@@'.StringUtil::getRandomID().'@@';
// build tag
$tag = $this->buildTag($matches[1]);
* @return string
*/
protected function cacheURLsCallback($matches) {
- $hash = '@@'.StringUtil::getHash(uniqid(microtime()).$matches[0]).'@@';
+ $hash = '@@'.StringUtil::getRandomID().'@@';
$this->cachedURLs[$hash] = $matches[0];
return $hash;
* @return string
*/
protected function cacheEmailsCallback($matches) {
- $hash = '@@'.StringUtil::getHash(uniqid(microtime()).$matches[0]).'@@';
+ $hash = '@@'.StringUtil::getRandomID().'@@';
$this->cachedEmails[$hash] = $matches[0];
return $hash;
*/
public static function pushToStringStack($string, $type = 'default', $delimiter = '@@') {
self::$i++;
- $hash = $delimiter.StringUtil::getHash(self::$i.uniqid(microtime()).$string).$delimiter;
+ $hash = $delimiter.StringUtil::getRandomID().$delimiter;
if (!isset(self::$stringStack[$type])) {
self::$stringStack[$type] = [];
* @return string
*/
public static function getRandomFieldName($fieldName) {
- $hash = StringUtil::getHash($fieldName . StringUtil::getRandomID());
+ $hash = StringUtil::getRandomID();
return substr($hash, 0, mt_rand(8, 16));
}
}