require "celluloid" module Celluloid module Extras class Rehasher include Celluloid def rehash(string, rounds) fail ArgumentError, "hurr" unless rounds > 1 penultimate = (rounds - 1).times.inject(string) { |s| Digest::SHA512.digest(s) } Digest::SHA512.hexdigest(penultimate) end end end end