apache-md5-0.6.0.0: Apache specific MD5 digest algorighm.

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

Data.Digest.ApacheMD5.Internal

Contents

Description

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.

Synopsis

Types

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.

Constructors

Salt ByteString 

ApacheMD5 Hash

apacheMD5Source

Arguments

:: (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.