foundation-0.0.13: Alternative prelude with batteries and no dependencies

LicenseBSD-style
MaintainerFoundation
Safe HaskellNone
LanguageHaskell2010

Foundation.Hashing

Contents

Description

 

Synopsis

Documentation

class Hashable a where

Type with the ability to be hashed

Hashable doesn't have any specific rules, and it's made for raw speed. More specifically don't expect different type representing the same data to hash to the same value

hashMix (1 :: Integer) /= hashMix (1 :: Word8)

True

Methods

hashMix :: Hasher st => a -> st -> st

class Hasher st

Incremental Hashing state. Represent an hashing algorithm

the base primitive of this class is hashMix8, append mix a Word8 in the state

The class allow to define faster mixing function that works on bigger Word size and any unboxed array of any PrimType elements

Minimal complete definition

hashNew, hashNewParam, hashMix8, hashEnd

Specific methods

data FNV1_32

FNV1 32 bit state

Instances

data FNV1_64

FNV1 64 bit state

Instances

data FNV1a_32

FNV1a 32 bit state

Instances

data FNV1a_64

FNV1a 64 bit state

Instances

data Sip1_3

Sip State 1-3 (1 compression rounds, 3 digest rounds)

Instances

data Sip2_4

Sip State 2-4 (2 compression rounds, 4 digest rounds)

Instances