hwsl2-0.3.1.1: Hashing with SL2

Safe HaskellTrustworthy
LanguageHaskell2010

Data.Hash.SL2.Mutable

Synopsis

Documentation

valid :: Ptr Hash -> IO Bool Source

O(1) Check a hash for bit-level validity.

eq :: Ptr Hash -> Ptr Hash -> IO Bool Source

O(1) Compare the two hashes for equality.

cmp :: Ptr Hash -> Ptr Hash -> IO Ordering Source

O(1) Compare two hashes.

unit :: Ptr Hash -> IO () Source

O(1) Set the Hash to the empty value.

concat :: Ptr Hash -> Ptr Hash -> Ptr Hash -> IO () Source

O(1) Concatenate the second and third Hash, store the result in the first.

append :: ByteString -> Ptr Hash -> IO () Source

O(n) Append the hash of the ByteString to the existing Hash.

prepend :: ByteString -> Ptr Hash -> IO () Source

O(n) Prepend the hash of the ByteString to the existing Hash.

foldAppend :: Foldable t => t ByteString -> Ptr Hash -> IO () Source

O(n) Append the hash of every ByteString to the existing Hash, from left to right.

foldPrepend :: Foldable t => t ByteString -> Ptr Hash -> IO () Source

O(n) Prepend the hash of every ByteString to the existing Hash, from right to left.

serialize :: Ptr Hash -> IO String Source

O(1) Serialize the hash into a url-safe base64 representation.

unserialize :: String -> Ptr Hash -> IO (Maybe ()) Source

O(1) Unserialize the hash from the representation generated by serialize.

withUnit :: (Ptr Hash -> IO a) -> IO (Hash, a) Source

withCopy :: Hash -> (Ptr Hash -> IO a) -> IO (Hash, a) Source