memory-0.13: memory and related abstraction stuff

License | BSD-style
Maintainer | Nicolas DI PRIMA <nicolas@di-prima.fr>
Stability | experimental
Portability | unknown
Safe Haskell | None
Language | Haskell2010

Data.Memory.Encoding.Base32

Description

Base32

Synopsis

- toBase32 :: Ptr Word8 -> Ptr Word8 -> Int -> IO ()
- unBase32Length :: Ptr Word8 -> Int -> IO (Maybe Int)
- fromBase32 :: Ptr Word8 -> Ptr Word8 -> Int -> IO (Maybe Int)

# Documentation

toBase32 #

Arguments

:: Ptr Word8 | input
-> Ptr Word8 | output
-> Int | input len
-> IO () |

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

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

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

Get the length needed for the destination buffer for a base32 decoding.

if the length is not a multiple of 8, Nothing is returned

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

convert from base32 in `src to binary in` dst, using the number of bytes specified

the user should use unBase32Length to compute the correct length, or check that the length specification is proper. no check is done here.