lsm-tree-0.1.0.0: Log-structured merge-trees
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.BloomFilter.Hash

Description

Fast hashing of Haskell values. The hash used is XXH3 64bit.

Synopsis

Basic hash functionality

type Hash = Word64 Source #

A hash value is 64 bits wide.

class Hashable a where Source #

The class of types that can be converted to a hash value.

The instances are meant to be stable, the hash values can be persisted.

Methods

hashSalt64 Source #

Arguments

:: Word64

seed

-> a

value to hash

-> Word64 

Compute a 64-bit hash of a value.

Instances

Instances details
Hashable ByteArray Source # 
Instance details

Defined in Data.BloomFilter.Hash

Hashable Word32 Source # 
Instance details

Defined in Data.BloomFilter.Hash

Hashable Word64 Source # 
Instance details

Defined in Data.BloomFilter.Hash

Hashable ByteString Source # 
Instance details

Defined in Data.BloomFilter.Hash

Hashable ByteString Source # 
Instance details

Defined in Data.BloomFilter.Hash

Hashable () Source # 
Instance details

Defined in Data.BloomFilter.Hash

Methods

hashSalt64 :: Word64 -> () -> Word64 Source #

Hashable Char Source # 
Instance details

Defined in Data.BloomFilter.Hash

Hashable Int Source # 
Instance details

Defined in Data.BloomFilter.Hash

Hashable Word Source # 
Instance details

Defined in Data.BloomFilter.Hash

Hashable a => Hashable [a] Source # 
Instance details

Defined in Data.BloomFilter.Hash

Methods

hashSalt64 :: Word64 -> [a] -> Word64 Source #

(Hashable a, Hashable b) => Hashable (a, b) Source # 
Instance details

Defined in Data.BloomFilter.Hash

Methods

hashSalt64 :: Word64 -> (a, b) -> Word64 Source #

hash64 :: Hashable a => a -> Word64 Source #

Compute a 64-bit hash.

hashByteArray :: ByteArray -> Int -> Int -> Word64 -> Word64 Source #

Hash a (part of) ByteArray.

Incremental hashing

class Incremental a where Source #

The class of types that can be incrementally hashed.

Methods

update :: HashState s -> a -> ST s () Source #

Instances

Instances details
Incremental Word32 Source # 
Instance details

Defined in Data.BloomFilter.Hash

Methods

update :: HashState s -> Word32 -> ST s () Source #

Incremental Word64 Source # 
Instance details

Defined in Data.BloomFilter.Hash

Methods

update :: HashState s -> Word64 -> ST s () Source #

Incremental ByteString Source # 
Instance details

Defined in Data.BloomFilter.Hash

Methods

update :: HashState s -> ByteString -> ST s () Source #

Incremental Char Source # 
Instance details

Defined in Data.BloomFilter.Hash

Methods

update :: HashState s -> Char -> ST s () Source #

data HashState s Source #

Hash state for incremental hashing

incrementalHash :: Word64 -> (forall s. HashState s -> ST s ()) -> Word64 Source #

Calculate incrementally constructed hash.