class RemiLib::Digest::XXHash32

Overview

An implementation of xxHash that produces 32-bit hashes using the XXH32 algorithm.

Defined in:

remilib/digest/xxhash.cr
remilib/digest/xxhash/xxhash32-internal.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Object

toRsconf(io : IO, *, indentSize : Int = 2, alwaysQuoteKeys : Bool = false, explicitRootObject : Bool = false, commaAfterValues : Bool = false, extraNewlineBetweenToplevelKeys : Bool = false) : Nil
toRsconf(*, indentSize : Int = 2, alwaysQuoteKeys : Bool = false, explicitRootObject : Bool = false, commaAfterValues : Bool = false, extraNewlineBetweenToplevelKeys : Bool = false) : String
toRsconf

Class methods inherited from class Object

fromRsconf(toplevel : RemiLib::RSConf::RSValue)
fromRsconf(data : String | IO | Path)
fromRsconf

Constructor Detail

def self.new(seed : UInt32 = 0) #

Creates a new XXHash32 instance that can be used to incrementally compute hashes.


[View source]

Class Method Detail

def self.calculate(buf : Bytes | Array(UInt8), seed : UInt32 = 0) #

Calculates the hash for buf and returns it.


[View source]
def self.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.


[View source]

Instance Method Detail

def hash : UInt32 #

Returns the current hash value.


[View source]
def reset(seed : UInt32 = 0) : Nil #

Resets this instance to its initial state. This can also be used to change the seed that is used.


[View source]
def update(buffer : Bytes | Array(UInt8)) : Nil #

Updates the current running hash using the bytes in buffer.


[View source]