Copyright | (c) 2013-2017 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | provisional |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
- digestToBS :: ByteArrayAccess a => a -> ByteString
- digestToBase :: ByteArrayAccess a => Base -> a -> ByteString
- hmacSHA1 :: (ByteArrayAccess a, ByteArray b) => a -> b -> HMAC SHA1
- hmacSHA256 :: (ByteArrayAccess a, ByteArray b) => a -> b -> HMAC SHA256
- hashSHA256 :: ByteArrayAccess a => a -> Digest SHA256
- hashMD5 :: ByteArrayAccess a => a -> Digest MD5
- hash :: (ByteArrayAccess ba, HashAlgorithm a) => ba -> Digest a
- hashlazy :: HashAlgorithm a => ByteString -> Digest a
- hashInit :: HashAlgorithm a => Context a
- hashUpdate :: (ByteArrayAccess ba, HashAlgorithm a) => Context a -> ba -> Context a
- hashFinalize :: HashAlgorithm a => Context a -> Digest a
- data HMAC a :: * -> *
- data Digest a :: * -> *
- class HashAlgorithm a
- data SHA256 :: * = SHA256
- data MD5 :: * = MD5
- data Base :: *
Conversion
digestToBS :: ByteArrayAccess a => a -> ByteString Source #
digestToBase :: ByteArrayAccess a => Base -> a -> ByteString Source #
Algorithms
hmacSHA1 :: (ByteArrayAccess a, ByteArray b) => a -> b -> HMAC SHA1 Source #
Apply an HMAC sha1 with the given secret to the given value.
hmacSHA256 :: (ByteArrayAccess a, ByteArray b) => a -> b -> HMAC SHA256 Source #
hashSHA256 :: ByteArrayAccess a => a -> Digest SHA256 Source #
Contexts
hash :: (ByteArrayAccess ba, HashAlgorithm a) => ba -> Digest a #
Hash a strict bytestring into a digest.
hashlazy :: HashAlgorithm a => ByteString -> Digest a #
Hash a lazy bytestring into a digest.
hashInit :: HashAlgorithm a => Context a #
Initialize a new context for this hash algorithm
hashUpdate :: (ByteArrayAccess ba, HashAlgorithm a) => Context a -> ba -> Context a #
run hashUpdates on one single bytestring and return the updated context.
hashFinalize :: HashAlgorithm a => Context a -> Digest a #
Finalize a context and return a digest.
Re-exported
Represent an HMAC that is a phantom type with the hash used to produce the mac.
The Eq instance is constant time.
Eq (HMAC a) | |
ByteArrayAccess (HMAC a) | |
Represent a digest for a given hash algorithm.
class HashAlgorithm a #
Class representing hashing algorithms.
The interface presented here is update in place and lowlevel. the Hash module takes care of hidding the mutable interface properly.
hashBlockSize, hashDigestSize, hashInternalContextSize, hashInternalInit, hashInternalUpdate, hashInternalFinalize
SHA256 cryptographic hash algorithm
MD5 cryptographic hash algorithm
Data MD5 | |
Show MD5 | |
HashAlgorithm MD5 | |
type HashInternalContextSize MD5 | |
type HashDigestSize MD5 | |
type HashBlockSize MD5 | |
Different bases that can be used
See RFC4648 for details. In particular, Base64 can be standard or URL-safe. URL-safe encoding is often used in other specifications without padding characters.
Base16 | similar to hexadecimal |
Base32 | |
Base64 | standard Base64 |
Base64URLUnpadded | unpadded URL-safe Base64 |
Base64OpenBSD | Base64 as used in OpenBSD password encoding (such as bcrypt) |