memory-0.15.0: memory and related abstraction stuff

LicenseBSD-style
MaintainerNicolas DI PRIMA <nicolas@di-prima.fr>
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Data.Memory.Encoding.Base32

Description

Low-level Base32 encoding and decoding.

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

Synopsis

Documentation

toBase32 Source #

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) Source #

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) Source #

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.