Copyright | (c) Leo D 2023 |
---|---|
License | BSD-3-Clause |
Maintainer | leo@apotheca.io |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- constantTimeCompare :: ByteString -> ByteString -> Int -> IO Bool
- scrubMem :: Ptr a -> Int -> IO ()
- type HexEncodingFlags = Word32
- pattern HexUpperCase :: HexEncodingFlags
- pattern HexLowerCase :: HexEncodingFlags
- hexEncode :: ByteString -> HexEncodingFlags -> IO Text
- hexDecode :: Text -> IO ByteString
- base64Encode :: ByteString -> IO Text
- base64Decode :: Text -> IO ByteString
Documentation
:: ByteString | x |
-> ByteString | y |
-> Int | len |
-> IO Bool |
Returns 0 if x[0..len] == y[0..len], -1 otherwise.
type HexEncodingFlags = Word32 Source #
pattern HexUpperCase :: HexEncodingFlags Source #
pattern HexLowerCase :: HexEncodingFlags Source #
:: ByteString | x |
-> HexEncodingFlags | flags |
-> IO Text | y |
Performs hex encoding of binary data in x of size len bytes. The output buffer out must be of at least x*2 bytes in size. If flags contains BOTAN_FFI_HEX_LOWER_CASE, hex encoding will only contain lower-case letters, upper-case letters otherwise. Returns 0 on success, 1 otherwise. DISCUSS: Handling of positive return code / BOTAN_FFI_INVALID_VERIFIER? DISCUSS: Use of Text.decodeUtf8 - bad, partial function! - but safe here?
:: Text | hex_str |
-> IO ByteString | out |
"Hex decode some data" DISCUSS: Return value, maybe vs exception DISCUSS: Botan documentation is lacking here WARNING: Does not actually check that len is a multiple of 2
:: ByteString | x |
-> IO Text | out |