Parent

Methods

Hash

Public Instance Methods

to_sha2() click to toggle source
# File lib/merb-cache/core_ext/hash.rb, line 5
def to_sha2
  string = ""
  keys.sort_by{|k| k.to_s}.each do |k| 
    case self[k]
    when Array
      string << self[k].join
    when Hash
      string << self[k].to_sha2
    else
      string << self[k].to_s
    end
  end
  Digest::SHA2.hexdigest(string)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.