Crypto.Hash.SHA256

cryptohash-0.7.10: collection of crypto hashes, fast, pure and practical

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | unknown
Safe Haskell | Trustworthy
Language | Haskell98

Crypto.Hash.SHA256

Contents

- Incremental hashing Functions
- Single Pass hashing

Description

A module containing SHA256 bindings

Synopsis

- data Ctx = Ctx !ByteString
- data SHA256
- init :: Ctx
- update :: Ctx -> ByteString -> Ctx
- finalize :: Ctx -> ByteString
- hash :: ByteString -> ByteString
- hashlazy :: ByteString -> ByteString

# Documentation

data Ctx #

Constructors

Ctx !ByteString |

Instances

Hash Ctx SHA256 # |
Methods outputLength :: Tagged * SHA256 BitLength # blockLength :: Tagged * SHA256 BitLength # initialCtx :: Ctx # updateCtx :: Ctx -> ByteString -> Ctx # finalize :: Ctx -> ByteString -> SHA256 # hash :: ByteString -> SHA256 # hash' :: ByteString -> SHA256 #

data SHA256 #

Instances

Eq SHA256 # |
Methods (==) :: SHA256 -> SHA256 -> Bool # (/=) :: SHA256 -> SHA256 -> Bool #
Ord SHA256 # |
Methods compare :: SHA256 -> SHA256 -> Ordering # (<) :: SHA256 -> SHA256 -> Bool # (<=) :: SHA256 -> SHA256 -> Bool # (>) :: SHA256 -> SHA256 -> Bool # (>=) :: SHA256 -> SHA256 -> Bool # max :: SHA256 -> SHA256 -> SHA256 # min :: SHA256 -> SHA256 -> SHA256 #
Show SHA256 # |
Methods showsPrec :: Int -> SHA256 -> ShowS # show :: SHA256 -> String # showList :: [SHA256] -> ShowS #
Serialize SHA256 # |
Methods put :: Putter SHA256 # get :: Get SHA256 #
Hash Ctx SHA256 # |
Methods outputLength :: Tagged * SHA256 BitLength # blockLength :: Tagged * SHA256 BitLength # initialCtx :: Ctx # updateCtx :: Ctx -> ByteString -> Ctx # finalize :: Ctx -> ByteString -> SHA256 # hash :: ByteString -> SHA256 # hash' :: ByteString -> SHA256 #

# Incremental hashing Functions

init :: Ctx #

init a context

update :: Ctx -> ByteString -> Ctx #

update a context with a bytestring

finalize :: Ctx -> ByteString #

finalize the context into a digest bytestring

# Single Pass hashing

hash :: ByteString -> ByteString #

hash a strict bytestring into a digest bytestring

hashlazy :: ByteString -> ByteString #

hash a lazy bytestring into a digest bytestring