| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Crypto.Hash
Description
pure hash interface, supported hash algorithms:
- SHA1
- SHA224/SHA256
- SHA384/SHA512
- MD5
- Whirlpool
NOTE: performance is just about 1 / 5 - 1 / 15 of C/ASM implementations.
Synopsis
- class HashAlgorithm a where
- data SHA1
- data SHA224
- data SHA256
- data SHA384
- data SHA512
- data MD5
- data Whirlpool
- hash :: HashAlgorithm a => ByteString -> a
- hashLazy :: HashAlgorithm a => ByteString -> a
Documentation
class HashAlgorithm a where #
Hash algorithm interface
provides classic init/update/final API. however, user should call higher level API such as hash or hashLazy.
Minimal complete definition
hashBlockSize, hashDigestSize, hashInit, hashUpdate, hashFinal
Methods
hashBlockSize :: a -> Int #
hashDigestSize :: a -> Int #
hashUpdate :: Context a -> ByteString -> Context a #
Instances
| HashAlgorithm MD5 # | |
Defined in Crypto.Hash.MD5 | |
| HashAlgorithm SHA1 # | |
Defined in Crypto.Hash.SHA1 | |
| HashAlgorithm SHA224 # | |
Defined in Crypto.Hash.SHA256 | |
| HashAlgorithm SHA256 # | |
Defined in Crypto.Hash.SHA256 | |
| HashAlgorithm SHA384 # | |
Defined in Crypto.Hash.SHA512 | |
| HashAlgorithm SHA512 # | |
Defined in Crypto.Hash.SHA512 | |
| HashAlgorithm Whirlpool # | |
Defined in Crypto.Hash.Whirlpool | |
Instances
| Eq SHA1 # | |
| Show SHA1 # | |
| HashAlgorithm SHA1 # | |
Defined in Crypto.Hash.SHA1 | |
Instances
| Eq SHA224 # | |
| Show SHA224 # | |
| HashAlgorithm SHA224 # | |
Defined in Crypto.Hash.SHA256 | |
Instances
| Eq SHA256 # | |
| Show SHA256 # | |
| HashAlgorithm SHA256 # | |
Defined in Crypto.Hash.SHA256 | |
Instances
| Eq SHA384 # | |
| Show SHA384 # | |
| HashAlgorithm SHA384 # | |
Defined in Crypto.Hash.SHA512 | |
Instances
| Eq SHA512 # | |
| Show SHA512 # | |
| HashAlgorithm SHA512 # | |
Defined in Crypto.Hash.SHA512 | |
Instances
| Eq MD5 # | |
| Show MD5 # | |
| HashAlgorithm MD5 # | |
Defined in Crypto.Hash.MD5 | |
Instances
| Eq Whirlpool # | |
| Show Whirlpool # | |
| HashAlgorithm Whirlpool # | |
Defined in Crypto.Hash.Whirlpool | |
hash :: HashAlgorithm a => ByteString -> a #
Hash strict byte string
hashLazy :: HashAlgorithm a => ByteString -> a #
Hash lazy byte string