License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | experimental |
Portability | unknown |
Safe Haskell | Trustworthy |
Language | Haskell98 |
Crypto.Hash.Types
Description
Crypto hash types definitions
- class HashAlgorithm a where
- hashInit :: Context a
- hashUpdates :: Context a -> [ByteString] -> Context a
- hashFinalize :: Context a -> Digest a
- digestFromByteString :: ByteString -> Maybe (Digest a)
- newtype Context a = Context {}
- newtype Digest a = Digest {}
Documentation
class HashAlgorithm a where
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
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.
Instances
newtype Digest a
Represent a digest for a given hash algorithm.
Constructors
Digest | |
Fields
|