-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Various cryptographic hashes for bytestrings; CRC32 and Adler32 for now.
--   
--   This package provides efficient cryptographic hash implementations for
--   strict and lazy bytestrings. For now, CRC32 and Adler32 are supported;
--   they are implemented as FFI bindings to efficient code from zlib.
@package digest
@version 0.0.1.2


-- | Adler32 wrapper
module Data.Digest.Adler32

-- | The class of values for which Adler32 may be computed
class Adler32 a where adler32 = adler32Update 1

-- | Compute Adler32 checksum
adler32 :: Adler32 a => a -> Word32

-- | Given the Adler32 checksum of a string, compute Adler32 of its
--   concatenation with another string (t.i., incrementally update the
--   Adler32 hash value).
adler32Update :: Adler32 a => Word32 -> a -> Word32

-- | Compute Adler32 checksum
adler32 :: Adler32 a => a -> Word32

-- | Given the Adler32 checksum of a string, compute Adler32 of its
--   concatenation with another string (t.i., incrementally update the
--   Adler32 hash value).
adler32Update :: Adler32 a => Word32 -> a -> Word32
instance Data.Digest.Adler32.Adler32 Data.ByteString.Internal.ByteString
instance Data.Digest.Adler32.Adler32 Data.ByteString.Lazy.Internal.ByteString
instance Data.Digest.Adler32.Adler32 [GHC.Word.Word8]


-- | CRC32 wrapper
module Data.Digest.CRC32

-- | The class of values for which CRC32 may be computed
class CRC32 a where crc32 = crc32Update 0

-- | Compute CRC32 checksum
crc32 :: CRC32 a => a -> Word32

-- | Given the CRC32 checksum of a string, compute CRC32 of its
--   concatenation with another string (t.i., incrementally update the
--   CRC32 hash value)
crc32Update :: CRC32 a => Word32 -> a -> Word32

-- | Compute CRC32 checksum
crc32 :: CRC32 a => a -> Word32

-- | Given the CRC32 checksum of a string, compute CRC32 of its
--   concatenation with another string (t.i., incrementally update the
--   CRC32 hash value)
crc32Update :: CRC32 a => Word32 -> a -> Word32
instance Data.Digest.CRC32.CRC32 Data.ByteString.Internal.ByteString
instance Data.Digest.CRC32.CRC32 Data.ByteString.Lazy.Internal.ByteString
instance Data.Digest.CRC32.CRC32 [GHC.Word.Word8]
