Class: XXH3::Digest128
- Inherits:
-
Digest::Class
- Object
- Digest::Class
- XXH3::Digest128
- Defined in:
- lib/xxh3.rb
Constant Summary collapse
- DIGEST_LENGTH =
16- BLOCK_LENGTH =
64
Class Method Summary collapse
Instance Method Summary collapse
- #block_length ⇒ Object
- #digest_length ⇒ Object
- #finish ⇒ Object
-
#initialize ⇒ Digest128
constructor
A new instance of Digest128.
- #reset ⇒ Object
- #update(data) ⇒ Object (also: #<<)
Constructor Details
#initialize ⇒ Digest128
Returns a new instance of Digest128.
88 89 90 91 |
# File 'lib/xxh3.rb', line 88 def initialize super @hasher = Hasher128.new end |
Class Method Details
.digest(data) ⇒ Object
78 79 80 |
# File 'lib/xxh3.rb', line 78 def self.digest(data) XXH3.xxh128_digest(data) end |
.hexdigest(data) ⇒ Object
83 84 85 |
# File 'lib/xxh3.rb', line 83 def self.hexdigest(data) digest(data).unpack1("H*") end |
Instance Method Details
#block_length ⇒ Object
117 118 119 |
# File 'lib/xxh3.rb', line 117 def block_length BLOCK_LENGTH end |
#digest_length ⇒ Object
112 113 114 |
# File 'lib/xxh3.rb', line 112 def digest_length DIGEST_LENGTH end |
#finish ⇒ Object
107 108 109 |
# File 'lib/xxh3.rb', line 107 def finish @hasher.finish end |
#reset ⇒ Object
94 95 96 97 |
# File 'lib/xxh3.rb', line 94 def reset @hasher.reset self end |
#update(data) ⇒ Object Also known as: <<
100 101 102 103 |
# File 'lib/xxh3.rb', line 100 def update(data) @hasher.update(data) self end |