Skip to content

Instantly share code, notes, and snippets.

@ang3lkar
Created July 17, 2014 09:11
Show Gist options
  • Save ang3lkar/31d813fea261a4887f84 to your computer and use it in GitHub Desktop.
Save ang3lkar/31d813fea261a4887f84 to your computer and use it in GitHub Desktop.
Hash to checksum
# 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