Unverified Commit 9ea21dba authored by catch's avatar catch Committed by damiankloip
Browse files

Issue #2995457 by catch, mcdruid: Human readable hashed memcache keys

parent 93dcfe2d
......@@ -94,7 +94,8 @@ abstract class DrupalMemcacheBase implements DrupalMemcacheInterface {
// hashing algorithm. Sha1 was selected as the default as it performs
// quickly with minimal collisions.
if (strlen($full_key) > 250) {
$full_key = urlencode(hash($this->hashAlgorithm, $this->prefix . '-' . $key));
$full_key = urlencode($this->prefix . '-' . hash($this->hashAlgorithm, $key));
$full_key .= '-' . substr(urlencode($key), 0, (250 - 1) - strlen($full_key) - 1);
}
return $full_key;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment