Created
July 17, 2014 09:11
-
-
Save ang3lkar/31d813fea261a4887f84 to your computer and use it in GitHub Desktop.
Hash to checksum
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
# Thanks to tenderlove on Peepcode play by play | |
require 'digest/md5' | |
def fetch username | |
records = JSON.parse get username | |
records.each do |hash| | |
checksum = Digest::MD5.hexdigest Marshal.dump(hash) | |
hash['checksum'] = checksum | |
end | |
records | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment