bytehash-0.1.0.0: Universal hashing of bytes

Safe HaskellNone
LanguageHaskell2010

Data.Bytes.HashMap.Word

Contents

Description

Implementation of static hash map data structure.

Synopsis

Documentation

data Map Source #

A static perfect hash table where the keys are byte arrays. This table cannot be updated after its creation, but all lookups have guaranteed O(1) worst-case cost. It consumes linear space. This is an excellent candidate for use with compact regions.

fromTrustedList :: [(Bytes, Word)] -> Map Source #

Build a map from keys that are known at compile time. All keys must be 64 bytes or less. This uses a built-in source of entropy and is entirely deterministic. An adversarial user could feed this function keys that cause it to error out rather than completing.

fromListWith Source #

Arguments

:: CryptHandle

Source of randomness

-> (Word -> Word -> Word) 
-> [(Bytes, Word)] 
-> IO Map 

Used for testing

distinctEntropies :: Map -> Int Source #

The number of non-matching entropies being used.