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

LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilityexperimental
Portabilityunknown
Safe HaskellTrustworthy
LanguageHaskell98

Crypto.Hash.Types

Contents

Description

Crypto hash types definitions

Synopsis

Documentation

class HashAlgorithm a where

Class representing hashing algorithms.

The hash algorithm is built over 3 primitives:

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

Methods

hashBlockSize :: Context a -> Int

Block size in bytes the hash algorithm operates on

hashInit :: Context a

Initialize a new context for this hash algorithm

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

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

hashFinalize :: Context a -> Digest a

Finalize a context and return a digest.

digestFromByteString :: ByteString -> Maybe (Digest a)

Try to convert a binary digest bytestring to a digest.

newtype Context a

Represent a context for a given hash algorithm.

Constructors

Context ByteString 

Instances

newtype Digest a

Represent a digest for a given hash algorithm.

Constructors

Digest ByteString 

Instances

Eq (Digest a) 
Ord (Digest a) 
Show (Digest a) 
Byteable (Digest a) 

deprecated

contextToByteString :: Context a -> ByteString

return the binary bytestring. deprecated use toBytes.

digestToByteString :: Digest a -> ByteString

Deprecated: use toBytes from byteable:Data.Byteable

return the binary bytestring. deprecated use toBytes.