class Celluloid::Extras::Rehasher

Public Instance Methods

rehash(string, rounds) click to toggle source
# File lib/celluloid/extras/rehasher.rb, line 8
def rehash(string, rounds)
  fail ArgumentError, "hurr" unless rounds > 1
  penultimate = (rounds - 1).times.inject(string) { |a, e| Digest::SHA512.digest(a) }
  Digest::SHA512.hexdigest(penultimate)
end