class RemiLib::Digest::XXHash64

Overview

An implementation of xxHash that produces 64-bit hashes using the XXH64 algorithm.

Defined in:

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

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

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

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


[View source]

Class Method Detail

def self.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.


[View source]
def self.calculate(buf : Bytes | Array(UInt8), seed : UInt64 = 0) #

Calculates the hash for buf and returns it.


[View source]

Instance Method Detail

def hash : UInt64 #

Returns the current hash value.


[View source]
def reset(seed : UInt64 = 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]