Archive for the 'Ruby' Category



How to find the SHA1 hash of a string in Ruby

To find the SHA1 hash of a string, first include the library 'digest/sha1' then use the code below, where 'password' is the string we're computing the hash of.
Click here to view the below code as plain text
CODE:

require ‘digest/sha1′

# ... then later on ...

password = "blah"

sha1_pass = Digest::SHA1.hexdigest(password)




About

You are currently browsing the DiscoMoose weblog archives for the 'Ruby' category.

Longer entries are truncated. Click the headline of an entry to read it in its entirety.

Categories

Categories