HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

ModulepureMD5-2.1.4Haskell2010

Data.Digest.Pure.MD5

It is suggested you use the 'crypto-api' class-based interface to access the MD5 algorithm. Either rely on type inference or provide an explicit type:

  hashFileStrict = liftM hash' . B.readFile
  hashFileLazyBS = liftM hash . B.readFile
  • 2 types
  • 1 class
  • 5 values
  • PackagepureMD5-2.1.4
  • Exports8
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceMD5.hs

Types

2 declarations
datadata MD5Digest
#

After finalizing a context, using md5Finalize, a new type is returned to prevent 're-finalizing' the structure.

Instances6Eq, Ord, Show, Binary, Serialize, Hash

Static data

1 declaration

Functions

4 declarations
valuemd5 :: ByteString -> MD5Digest
#

Processes a lazy ByteString and returns the md5 digest. This is probably what you want. You can use show to produce the standard hex representation.

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)!

Crypto-API interface

1 declaration
classclass (Serialize d, Eq d, Ord d) => Hash ctx d | d -> ctx, ctx -> d where
#

The Hash class is intended as the generic interface targeted by maintainers of Haskell digest implementations. Using this generic interface, higher level functions such as hash and hash' provide a useful API for comsumers of hash implementations.

Any instantiated implementation must handle unaligned data.

Minimum complete definition: outputLength, blockLength, initialCtx, updateCtx, and finalize.

Methods

Instances1Hash