Binary encoding utility functions.
More...
#include <stdint.h>
Go to the source code of this file.
|
#define | enc_uint8_le(b, v) |
| Encodes a "little-endian" 8-bit unsigned integer into a byte array. This macro is provided for consistency when used with other encoding functions provided by the header.
|
|
|
void | enc_uint16_le (uint8_t *b, uint16_t v) |
| Encodes a little-endian 16-bit unsigned integer into a byte array.
|
|
void | enc_uint32_le (uint8_t *b, uint32_t v) |
| Encodes a little-endian 32-bit unsigned integer into a byte array.
|
|
void | enc_uint64_le (uint8_t *b, uint64_t v) |
| Encodes a little-endian 64-bit unsigned integer into a byte array.
|
|
Binary encoding utility functions.
◆ enc_uint8_le
#define enc_uint8_le |
( |
| b, |
|
|
| v ) |
Value:
Encodes a "little-endian" 8-bit unsigned integer into a byte array. This macro is provided for consistency when used with other encoding functions provided by the header.
- Note
- This macro is equivalent to
b[0] = v
.
- Parameters
-
b | byte array to encode into |
v | value to encode |
◆ enc_uint16_le()
void enc_uint16_le |
( |
uint8_t * | b, |
|
|
uint16_t | v ) |
Encodes a little-endian 16-bit unsigned integer into a byte array.
- Parameters
-
b | byte array to encode into |
v | value to encode |
◆ enc_uint32_le()
void enc_uint32_le |
( |
uint8_t * | b, |
|
|
uint32_t | v ) |
Encodes a little-endian 32-bit unsigned integer into a byte array.
- Parameters
-
b | byte array to encode into |
v | value to encode |
◆ enc_uint64_le()
void enc_uint64_le |
( |
uint8_t * | b, |
|
|
uint64_t | v ) |
Encodes a little-endian 64-bit unsigned integer into a byte array.
- Parameters
-
b | byte array to encode into |
v | value to encode |