class Digest::SipHash
Constants
- DEFAULT_KEY
- VERSION
Attributes
key[RW]
Public Class Methods
new(c_rounds = 1, d_rounds = 3, key: DEFAULT_KEY)
click to toggle source
# File lib/digest/sip_hash.rb, line 12 def initialize c_rounds = 1, d_rounds = 3, key: DEFAULT_KEY @c_rounds = c_rounds @d_rounds = d_rounds @key = key @buffer = +'' end
Public Instance Methods
<<(s)
click to toggle source
# File lib/digest/sip_hash.rb, line 19 def << s @buffer << s self end
Also aliased as: update
finish()
click to toggle source
# File lib/digest/sip_hash.rb, line 30 def finish sip = Sip.new @buffer, @c_rounds, @d_rounds, @key sip.transform sip.finalize end
reset()
click to toggle source
# File lib/digest/sip_hash.rb, line 25 def reset @buffer.clear self end