limb 0.2.0

2024-01-09

u64_le(3)
limb manual
u64_le(3)

NAME

u64_le, u64_be, u64p_le, u64p_be - convert an u64 to little/big endian

u64pa_le, u64pa_be - convert an array of u64 into little/big endian

SYNOPSIS

#include <limb/u64.h>
u64 u64_le(u64 u)
u64 u64_be(u64 u)

void u64p_le(u64 *val)
void u64p_be(u64 *val)

void u64pa_le(u64 *val, size_t len)
void u64pa_be(u64 *val, size_t len)

DESCRIPTION

All of these aim to ensure a value or variable is in expected endianness.

The u64_le() and u64_be() macros will return the value after having read the given number u as a little endian or big endian value, respectively.

The u64p_le() and u64p_be() macros are similar, only they take a pointer to an u64 and will convert it into little endian or big endian, respectively.

Finally the u64pa_le() and u64pa_be() macros are similar to the previous two, only they take an array of u64 of size len and convert every element.

Note

Note that these are macros they may be either no-op or byte swapping functions depending on the endianness of the host.

RETURN VALUE

Only u64_le() and u64_be() have a return value, that of the number u read as a little or big endian number, respectively.

limb 0.1.0
2023-07-24
u64_le(3)