class RemiLib::Digest::XXHash64
- RemiLib::Digest::XXHash64
- RemiLib::Digest::XXHashInternal
- Reference
- Object
Overview
An implementation of xxHash that produces 64-bit hashes using the XXH64 algorithm.
Defined in:
remilib/digest/xxhash.crremilib/digest/xxhash/xxhash64-internal.cr
Constructors
-
.new(seed : UInt64 = 0)
Creates a new
XXHash64
instance that can be used to incrementally compute hashes.
Class Method Summary
-
.calculate(io : IO, bufSize : Int = 4096) : UInt64
Calculates the hash by reading from io until the end of the stream, then returns the calculated hash.
-
.calculate(buf : Bytes | Array(UInt8), seed : UInt64 = 0)
Calculates the hash for buf and returns it.
Instance Method Summary
-
#hash : UInt64
Returns the current hash value.
-
#reset(seed : UInt64 = 0) : Nil
Resets this instance to its initial state.
-
#update(buffer : Bytes | Array(UInt8)) : Nil
Updates the current running hash using the bytes in buffer.
Constructor Detail
Creates a new XXHash64
instance that can be used to incrementally compute
hashes.
Class Method Detail
Calculates the hash by reading from io until the end of the stream, then returns the calculated hash.
Calculates the hash for buf and returns it.
Instance Method Detail
Resets this instance to its initial state. This can also be used to change the seed that is used.
Updates the current running hash using the bytes in buffer.