class RemiLib::Digest::SpookyHash

Overview

An implementation of SpookyHash that produces 128-, 64-, and 32-bit hashes.

Defined in:

remilib/digest/spookyhash.cr
remilib/digest/spookyhash/globals.cr
remilib/digest/spookyhash/spookyhashinternal.cr

Constant Summary

VERSION = "1.0.7"

The version of the algorithm that's supported.

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(seed1 : UInt64, seed2 : UInt64) #

Creates a new SpookyHash instance. seed1 is the first eight bytes of a custom seed, while seed2 is the last eight bytes of a custom seed.


[View source]
def self.new #

Creates a new SpookyHash instance.


[View source]

Class Method Detail

def self.calculate128(input : Bytes, inputHash : UInt128 = 0) : UInt128 #

[View source]
def self.calculate32(input : Bytes, seed : UInt32 = 0) : UInt32 #

[View source]
def self.calculate64(input : Bytes, seed : UInt64 = 0) : UInt64 #

[View source]

Instance Method Detail

def hash : UInt128 #
Description copied from class Object

Generates an UInt64 hash value for this object.

This method must have the property that a == b implies a.hash == b.hash.

The hash value is used along with == by the Hash class to determine if two objects reference the same hash key.

Subclasses must not override this method. Instead, they must define hash(hasher), though usually the macro def_hash can be used to generate this method.


[View source]
def hash32 : UInt32 #

[View source]
def hash64 : UInt64 #

[View source]
def update(input : Bytes) : Nil #

[View source]