foundation-0.0.29: Alternative prelude with batteries and no dependencies
License BSD-style
Maintainer Foundation
Safe Haskell None
Language Haskell2010

Foundation.Hashing

Description

Synopsis

Documentation

class Hashable a where Source #

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 Source #

Instances

Instances details
Hashable Int8 Source #
Instance details

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => Int8 -> st -> st Source #

Hashable Int16 Source #
Instance details

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => Int16 -> st -> st Source #

Hashable Int32 Source #
Instance details

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => Int32 -> st -> st Source #

Hashable Int64 Source #
Instance details

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => Int64 -> st -> st Source #

Hashable Integer Source #
Instance details

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => Integer -> st -> st Source #

Hashable Natural Source #
Instance details

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => Natural -> st -> st Source #

Hashable Word8 Source #
Instance details

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => Word8 -> st -> st Source #

Hashable Word16 Source #
Instance details

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => Word16 -> st -> st Source #

Hashable Word32 Source #
Instance details

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => Word32 -> st -> st Source #

Hashable Word64 Source #
Instance details

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => Word64 -> st -> st Source #

Hashable String Source #
Instance details

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => String -> st -> st Source #

Hashable Word256 Source #
Instance details

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => Word256 -> st -> st Source #

Hashable Word128 Source #
Instance details

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => Word128 -> st -> st Source #

Hashable IPv6 Source #
Instance details

Defined in Foundation.Network.IPv6

Methods

hashMix :: Hasher st => IPv6 -> st -> st Source #

Hashable IPv4 Source #
Instance details

Defined in Foundation.Network.IPv4

Methods

hashMix :: Hasher st => IPv4 -> st -> st Source #

Hashable UUID Source #
Instance details

Defined in Foundation.UUID

Methods

hashMix :: Hasher st => UUID -> st -> st Source #

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

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => [a] -> st -> st Source #

Hashable a => Hashable ( Array a) Source #
Instance details

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => Array a -> st -> st Source #

PrimType a => Hashable ( UArray a) Source #
Instance details

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => UArray a -> st -> st Source #

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

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => (a, b) -> st -> st Source #

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

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => Tuple2 a b -> st -> st Source #

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

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => (a, b, c) -> st -> st Source #

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

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => Tuple3 a b c -> st -> st Source #

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

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => (a, b, c, d) -> st -> st Source #

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

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => Tuple4 a b c d -> st -> st Source #

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

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => (a, b, c, d, e) -> st -> st Source #

( Hashable a, Hashable b, Hashable c, Hashable d, Hashable e, Hashable f) => Hashable (a, b, c, d, e, f) Source #
Instance details

Defined in Foundation.Hashing.Hashable

Methods

hashMix :: Hasher st => (a, b, c, d, e, f) -> st -> st Source #

class Hasher st Source #

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

Instances

Instances details
Hasher Sip1_3 Source #
Instance details

Defined in Foundation.Hashing.SipHash

Associated Types

type HashResult Sip1_3

type HashInitParam Sip1_3

Hasher Sip2_4 Source #
Instance details

Defined in Foundation.Hashing.SipHash

Associated Types

type HashResult Sip2_4

type HashInitParam Sip2_4

Hasher FNV1a_64 Source #
Instance details

Defined in Foundation.Hashing.FNV

Associated Types

type HashResult FNV1a_64

type HashInitParam FNV1a_64

Hasher FNV1a_32 Source #
Instance details

Defined in Foundation.Hashing.FNV

Associated Types

type HashResult FNV1a_32

type HashInitParam FNV1a_32

Hasher FNV1_64 Source #
Instance details

Defined in Foundation.Hashing.FNV

Associated Types

type HashResult FNV1_64

type HashInitParam FNV1_64

Hasher FNV1_32 Source #
Instance details

Defined in Foundation.Hashing.FNV

Associated Types

type HashResult FNV1_32

type HashInitParam FNV1_32

Specific methods