Created
September 24, 2012 09:32
-
-
Save yuta-aoyagi/3775123 to your computer and use it in GitHub Desktop.
Calculate SHA1 hash of text file for each lines
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
require 'digest/sha1' | |
open(ARGV[0], "r") do |f| | |
f.each_line do |s| | |
print Digest::SHA1.hexdigest(s), " ", s | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment