class RemiLib::Digest::XXHash32
- RemiLib::Digest::XXHash32
- RemiLib::Digest::XXHashInternal
- Reference
- Object
Overview
An implementation of xxHash that produces 32-bit hashes using the XXH32 algorithm.
Defined in:
remilib/digest/xxhash.crremilib/digest/xxhash/xxhash32-internal.cr
Constructors
-
.new(seed : UInt32 = 0)
Creates a new
XXHash32
instance that can be used to incrementally compute hashes.
Class Method Summary
-
.calculate(buf : Bytes | Array(UInt8), seed : UInt32 = 0)
Calculates the hash for buf and returns it.
-
.calculate(io : IO, bufSize : Int = 4096) : UInt32
Calculates the hash by reading from io until the end of the stream, then returns the calculated hash.
Instance Method Summary
-
#hash : UInt32
Returns the current hash value.
-
#reset(seed : UInt32 = 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 XXHash32
instance that can be used to incrementally compute
hashes.
Class Method Detail
Calculates the hash for buf and returns it.
Calculates the hash by reading from io until the end of the stream, then returns the calculated hash.
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.