u16_pack(3)
limb manual
u16_pack(3)
NAME
u16_pack, u16_unpack, u16_pack_big, u16_unpack_big - store/read an u16 into/from a byte array
SYNOPSIS
#include <limb/u16.h>
void u16_pack(void *dst, u16 val) void u16_unpack(u16 *val, const void *sce) void u16_pack_big(void *dst, u16 val) void u16_unpack_big(u16 *val, const void *sce)
DESCRIPTION
All of these aim to either store the given number val
into the specified
byte array dst
, or read a number from the specified byte array sce
and set
the value pointed by val
to its value.
The u16_pack
() function stores the number val
into the 2 bytes pointed by
dst
, encoded as little endian.
The u16_unpack
() function reads 2 bytes pointed by sce
as little endian
encoded number, setting the value pointed by val
to its value.
The u16_pack_big
() function is similar to u16_pack
() only as big endian.
The u16_unpack_big
() function is similar to u16_unpack
() only as big endian.