HashingMemcachedKeySanitizer uses the provided HashingAlgorithm to create a valid Memcached key using characters in hexadecimal.
Wrapper around spymemcached
Wrapper around spymemcached
Author: chris Created: 2/19/13
Trait that you can use to define your own Memcached key sanitiser
Author: c-birchall Date: 13/11/14
Sanitizer that replaces characters invalid for Memcached and truncates keys if they are over a certain limit.
Sanitizer that replaces characters invalid for Memcached and truncates keys if they are over a certain limit.
Convenient because it creates human-readable keys, but only safe for ASCII chars.
optional, defaults to an underscore
optional, defaults to 250, which is the max length of a Memcached key
HashingMemcachedKeySanitizer uses the provided HashingAlgorithm to create a valid Memcached key using characters in hexadecimal. You may want to use this MemcachedKeySanitizer if there is a possibility that your keys will contain non-ASCII characters.
Make sure that the HashingAlgorithm you provide does not produce strings that are beyond 250 characters when combined with any additional namespacing that your MemcachedClient or proxy automatically inserts for you.