hashed-storage-0.4.13: Hashed file storage support code.Source codeContentsIndex
Storage.Hashed.Hash
Synopsis
data Hash
= SHA256 !ByteString
| SHA1 !ByteString
| NoHash
encodeBase64u :: Hash -> ByteString
decodeBase64u :: ByteString -> Hash
encodeBase16 :: Hash -> ByteString
decodeBase16 :: ByteString -> Hash
sha256 :: ByteString -> Hash
rawHash :: Hash -> ByteString
match :: Hash -> Hash -> Bool
Documentation
data Hash Source
Constructors
SHA256 !ByteString
SHA1 !ByteString
NoHash
encodeBase64u :: Hash -> ByteStringSource
decodeBase64u :: ByteString -> HashSource
Take a base64/url-encoded string and decode it as a Hash. If the string is malformed, yields NoHash.
encodeBase16 :: Hash -> ByteStringSource
Produce a base16 (ascii-hex) encoded string from a hash. This can be turned back into a Hash (see decodeBase16. This is a loss-less process.
decodeBase16 :: ByteString -> HashSource
Take a base16-encoded string and decode it as a Hash. If the string is malformed, yields NoHash.
sha256 :: ByteString -> HashSource
Compute a sha256 of a (lazy) ByteString. However, although this works correctly for any bytestring, it is only efficient if the bytestring only has a sigle chunk.
rawHash :: Hash -> ByteStringSource
match :: Hash -> Hash -> BoolSource
Produced by Haddock version 2.6.0