Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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
- hashBlockSize :: a -> Int
- hashDigestSize :: a -> Int
- hashInit :: Context a
- hashUpdate :: Context a -> ByteString -> Context a
- hashFinal :: Context a -> a
- 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 Source #
Hash algorithm interface
provides classic init/update/final API. however, user should call higher level API such as hash or hashLazy.
hashBlockSize :: a -> Int Source #
hashDigestSize :: a -> Int Source #
hashInit :: Context a Source #
hashUpdate :: Context a -> ByteString -> Context a Source #
hash :: HashAlgorithm a => ByteString -> a Source #
Hash strict byte string
hashLazy :: HashAlgorithm a => ByteString -> a Source #
Hash lazy byte string