Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Hash
- = SHA256 !ByteString
- | NoHash
- encodeBase16 :: Hash -> ByteString
- decodeBase16 :: ByteString -> Hash
- sha256 :: ByteString -> Hash
- sha256sum :: ByteString -> String
- rawHash :: Hash -> ByteString
- match :: Hash -> Hash -> Bool
- sha1PS :: ByteString -> SHA1
- data SHA1
- showAsHex :: Word32 -> String
- sha1Xor :: SHA1 -> SHA1 -> SHA1
- sha1zero :: SHA1
- sha1short :: SHA1 -> Word32
Documentation
encodeBase16 :: Hash -> ByteString Source #
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 -> Hash Source #
Take a base16-encoded string and decode it as a Hash. If the string is malformed, yields NoHash.
sha256 :: ByteString -> Hash Source #
Compute a sha256 of a (lazy) ByteString.
sha256sum :: ByteString -> String Source #
Same as previous but general purpose.
rawHash :: Hash -> ByteString Source #
sha1PS :: ByteString -> SHA1 Source #