Skip to content

Instantly share code, notes, and snippets.

@dteoh
Last active March 22, 2016 07:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dteoh/0f4952437767cb0e7008 to your computer and use it in GitHub Desktop.
Save dteoh/0f4952437767cb0e7008 to your computer and use it in GitHub Desktop.
Get numeric value from hash digest
require 'digest'
key = 'the value to hash'
num = Digest::MD5.digest(key).unpack('L').first
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment