limb 0.2.0

2024-01-09

u32_pack(3)
limb manual
u32_pack(3)

NAME

u32_pack, u32_unpack, u32_pack_big, u32_unpack_big - store/read an u32 into/from a byte array

SYNOPSIS

#include <limb/u32.h>
void u32_pack(void *dst, u32 val)
void u32_unpack(u32 *val, const void *sce)

void u32_pack_big(void *dst, u32 val)
void u32_unpack_big(u32 *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 u32_pack() function stores the number val into the 4 bytes pointed by dst, encoded as little endian.

The u32_unpack() function reads 4 bytes pointed by sce as little endian encoded number, setting the value pointed by val to its value.

The u32_pack_big() function is similar to u32_pack() only as big endian.

The u32_unpack_big() function is similar to u32_unpack() only as big endian.

limb 0.1.0
2023-07-24
u32_pack(3)