Created
January 30, 2014 16:18
-
-
Save nickboyce/8712280 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ActiveSupport | |
module Cache | |
class IronCache < ActiveSupport::Cache::Store | |
def escape_key(key) | |
ekey = ::Base64.encode64(key).gsub("\n",'').gsub("/",'') | |
if ekey.size > 250 | |
ekey = "#{ekey[0, 213]}:md5:#{Digest::MD5.hexdigest(ekey)}" | |
end | |
ekey | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment