Skip to content

Instantly share code, notes, and snippets.

@cliffom
Created December 15, 2017 18:59
Show Gist options
  • Save cliffom/3a61ba99d6a0a5ceabd7baf6233a5174 to your computer and use it in GitHub Desktop.
Save cliffom/3a61ba99d6a0a5ceabd7baf6233a5174 to your computer and use it in GitHub Desktop.
#!/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