Class: XXH3::Digest64
- Inherits:
-
Digest::Class
- Object
- Digest::Class
- XXH3::Digest64
- Defined in:
- lib/xxh3.rb
Constant Summary collapse
- DIGEST_LENGTH =
8- BLOCK_LENGTH =
64
Class Method Summary collapse
Instance Method Summary collapse
- #block_length ⇒ Object
- #digest_length ⇒ Object
- #finish ⇒ Object
-
#initialize ⇒ Digest64
constructor
A new instance of Digest64.
- #reset ⇒ Object
- #update(data) ⇒ Object (also: #<<)
Constructor Details
#initialize ⇒ Digest64
Returns a new instance of Digest64.
38 39 40 41 |
# File 'lib/xxh3.rb', line 38 def initialize super @hasher = Hasher64.new end |
Class Method Details
.digest(data) ⇒ Object
28 29 30 |
# File 'lib/xxh3.rb', line 28 def self.digest(data) XXH3.xxh3_digest(data) end |
.hexdigest(data) ⇒ Object
33 34 35 |
# File 'lib/xxh3.rb', line 33 def self.hexdigest(data) digest(data).unpack1("H*") end |
Instance Method Details
#block_length ⇒ Object
67 68 69 |
# File 'lib/xxh3.rb', line 67 def block_length BLOCK_LENGTH end |
#digest_length ⇒ Object
62 63 64 |
# File 'lib/xxh3.rb', line 62 def digest_length DIGEST_LENGTH end |
#finish ⇒ Object
57 58 59 |
# File 'lib/xxh3.rb', line 57 def finish @hasher.finish end |
#reset ⇒ Object
44 45 46 47 |
# File 'lib/xxh3.rb', line 44 def reset @hasher.reset self end |
#update(data) ⇒ Object Also known as: <<
50 51 52 53 |
# File 'lib/xxh3.rb', line 50 def update(data) @hasher.update(data) self end |