Class: Noise::Functions::Hash::Blake3

Inherits:
Object
  • Object
show all
Defined in:
lib/noise/functions/hash/blake3.rb

Constant Summary collapse

HASHLEN =
32
BLOCKLEN =
64

Instance Method Summary collapse

Constructor Details

#initializeBlake3

Returns a new instance of Blake3.



12
13
14
# File 'lib/noise/functions/hash/blake3.rb', line 12

def initialize
  Noise.optional_dependency!('blake3')
end

Instance Method Details

#blocklenObject



24
25
26
# File 'lib/noise/functions/hash/blake3.rb', line 24

def blocklen
  BLOCKLEN
end

#hash(data) ⇒ Object



16
17
18
# File 'lib/noise/functions/hash/blake3.rb', line 16

def hash(data)
  ::Blake3.digest(data)
end

#hashlenObject



20
21
22
# File 'lib/noise/functions/hash/blake3.rb', line 20

def hashlen
  HASHLEN
end