Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'digest'
- require 'benchmark'
- sha256 = Digest::SHA256.new
- salt = "Super Random Salt!!!"
- message = "This is my password!"
- [1, 50, 500, 5000, 5000, 50000].each {|rounds|
- puts "Running #{rounds} times:"
- puts Benchmark.measure {
- rounds.times do
- message = sha256.digest(message+salt)
- end
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment