cryptonite-0.29: Cryptography Primitives sink
LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilityexperimental
PortabilityGood
Safe HaskellNone
LanguageHaskell2010

Crypto.Number.Serialize.Internal.LE

Description

Fast serialization primitives for integer using raw pointers (little endian)

Synopsis

Documentation

i2osp :: Integer -> Ptr Word8 -> Int -> IO Int #

Fill a pointer with the little endian binary representation of an integer

If the room available ptrSz is less than the number of bytes needed, 0 is returned. Likewise if a parameter is invalid, 0 is returned.

Returns the number of bytes written

i2ospOf :: Integer -> Ptr Word8 -> Int -> IO Int #

Similar to i2osp, except it will pad any remaining space with zero.

os2ip :: Ptr Word8 -> Int -> IO Integer #

Transform a little endian binary integer representation pointed by a pointer and a size into an integer