To get an MD5 digest of a lazy ByteString (you probably want this): hash = md5 lazyByteString
Alternativly, for a context that can be further updated/finalized: partialCtx = md5Update md5InitialContext partOfFile
And you finialize the context with: hash = md5Finalize partialCtx
- data MD5Context
- data MD5Digest
- md5InitialContext :: MD5Context
- blockSize :: BlockCipher k => Tagged k BitLength
- md5 :: ByteString -> MD5Digest
- md5Update :: MD5Context -> ByteString -> MD5Context
- md5Finalize :: MD5Context -> ByteString -> MD5Digest
Types
data MD5Context Source
The type for final results.
After finalizing a context, using md5Finalize, a new type is returned to prevent 're-finalizing' the structure.
Static data
md5InitialContext :: MD5ContextSource
The initial context to use when calling md5Update for the first time
:: BlockCipher k | |
=> Tagged k BitLength | The size of a single block; the smallest unit on which the cipher operates. |
Functions
md5 :: ByteString -> MD5DigestSource
Processes a lazy ByteString and returns the md5 digest. This is probably what you want.
md5Update :: MD5Context -> ByteString -> MD5ContextSource
Alters the MD5Context with a partial digest of the data.
The input bytestring MUST be a multiple of the blockSize or bad things can happen (incorrect digest results)!
md5Finalize :: MD5Context -> ByteString -> MD5DigestSource
Closes an MD5 context, thus producing the digest.