Created
December 15, 2017 18:59
-
-
Save cliffom/3a61ba99d6a0a5ceabd7baf6233a5174 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env ruby | |
require 'digest' | |
def getHash(data, iterations) | |
for i in 1..iterations-1 | |
data = Digest::SHA256.digest data | |
end | |
Digest::SHA256.hexdigest data | |
end | |
iterations = ARGV[0].to_i | |
data = File.read('rand.txt') | |
hash = getHash(data, iterations) | |
puts hash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment