Created
May 23, 2012 15:28
-
-
Save ktopping/2775902 to your computer and use it in GitHub Desktop.
gen md5 hash
This file contains hidden or 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
# note the caller ensures that "prefix" consists of something | |
# uniquely identifying the user/brochure combination | |
def images_key(images, prefix = "") | |
key = "#{prefix} " | |
images.each do |im| | |
key += "#{im.file.size} #{im.file_updated_at}" | |
end | |
Digest::MD5.new.hexdigest(key) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment