cryptohash-0.8.2: collection of crypto hashes, fast, pure and practical

Portabilityunknown
Stabilityexperimental
MaintainerVincent Hanquez <vincent@snarc.org>
Safe HaskellTrustworthy

Crypto.Hash.Types

Description

Crypto hash types definitions

Synopsis

Documentation

class HashAlgorithm a whereSource

Class representing hashing algorithms.

The hash algorithm is built over 3 primitives:

init : create a new context updates : update the context with some strict bytestrings finalize : finalize the context into a digest

Methods

hashInit :: Context aSource

Initialize a new context for this hash algorithm

hashUpdates :: Context a -> [ByteString] -> Context aSource

Update the context with a list of strict bytestring, and return a new context with the updates.

hashFinalize :: Context a -> Digest aSource

Finalize a context and return a digest.

digestFromByteString :: ByteString -> Maybe (Digest a)Source

Try to convert a binary digest bytestring to a digest.

newtype Context a Source

Represent a context for a given hash algorithm.

Constructors

Context 

newtype Digest a Source

Represent a digest for a given hash algorithm.

Constructors

Digest 

Fields

digestToByteString :: ByteString

Return the binary digest

Instances

Eq (Digest a) 
Eq (Digest a) => Ord (Digest a) 
Show (Digest a)