Data.Memory.Encoding.Base16

memory-0.18.0: memory and related abstraction stuff

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | unknown
Safe Haskell | None
Language | Haskell2010

Data.Memory.Encoding.Base16

Description

Low-level Base16 encoding and decoding.

If you just want to encode or decode some bytes, you probably want to use the Data.ByteArray.Encoding module.

Synopsis

- showHexadecimal :: (forall a. (Ptr Word8 -> IO a) -> IO a) -> Int -> String
- toHexadecimal :: Ptr Word8 -> Ptr Word8 -> Int -> IO ()
- fromHexadecimal :: Ptr Word8 -> Ptr Word8 -> Int -> IO (Maybe Int)

# Documentation

showHexadecimal #

Arguments

:: (forall a. (Ptr Word8 -> IO a) -> IO a) | a `with` type of function to hold reference to the object
-> Int | length in bytes
-> String |

Transform a raw memory to an hexadecimal `String`

user beware, no checks are made

toHexadecimal #

Arguments

:: Ptr Word8 | destination memory
-> Ptr Word8 | source memory
-> Int | number of bytes
-> IO () |

Transform a number of bytes pointed by.`src in the hexadecimal binary representation in` dst

destination memory need to be of correct size, otherwise it will lead to really bad things.

fromHexadecimal :: Ptr Word8 -> Ptr Word8 -> Int -> IO (Maybe Int) #

convert a base16 `src in` dst.

n need to even