apache-md5- Apache specific MD5 digest algorighm.

Portabilitynon-portable (BangPatterns, CPP, DeriveDataTypeable, DeriveGeneric, ForeignFunctionInterface, NoImplicitPrelude)
MaintainerPeter Trško <peter.trsko@gmail.com>
Safe HaskellNone




Internal and unsafe functions used for implementing Apache MD5 hash algorithm.

Try to avoid using this module directly when possible, but there are situations when it might come handy.



type Password = ByteStringSource

Type alias for more readable type signatures.

newtype Salt Source

Apache MD5 hash salt. When constructing .htpasswd file it is necessary for the salt to be consisting of octets from alpha64 "set". This newtype along with mkSalt smart constructor are here to ensure such invariant.


Salt ByteString 

ApacheMD5 Hash



:: (ByteString -> ByteString)

MD5 hash function.

-> Password 
-> Salt 
-> ByteString

Apache MD5 Hash

Raw Apache MD5 implementation that is parametrized by MD5 implementation and doesn't encode result in to base 64.

Base64-like encoding

alpha64 :: ByteStringSource

Alphabet used by encode64.

isAlpha64 :: Word8 -> BoolSource

Check if specified 8 bit word is a valid member of alpha64.

encode64 :: ByteString -> ByteStringSource

Encode raw MD5 hash in to Base64-like encoding.

OpenSSL Bindings

md5BS :: ByteString -> ByteStringSource

Thin Haskell wrapper around OpenSSL's MD5 hash function.

md5DigestLength :: IntSource

Length of MD5 hash in octets.