Nyx Node
|
Functions | |
void | nyx_generate_mac_addr (uint8_t result_mac[6], uint8_t mac0, uint8_t mac1, STR_t node_id) |
Generates a MAC address based on a node identifier. | |
__NULLABLE__ str_t | nyx_base64_encode (__NULLABLE__ size_t *result_len, __ZEROABLE__ size_t size, __NULLABLE__ BUFF_t buff) |
Encodes a buffer to a Base64-encoded string. | |
__NULLABLE__ buff_t | nyx_base64_decode (__NULLABLE__ size_t *result_size, __ZEROABLE__ size_t len, __NULLABLE__ STR_t str) |
Decodes a Base64-encoded string to a buffer. | |
uint32_t | nyx_hash32 (__ZEROABLE__ size_t size, __NULLABLE__ BUFF_t buff, uint32_t seed) |
Hashes a buffer using the MurmurHash2 algorithm. | |
Utilities.
void nyx_generate_mac_addr | ( | uint8_t | result_mac[6], |
uint8_t | mac0, | ||
uint8_t | mac1, | ||
STR_t | node_id ) |
Generates a MAC address based on a node identifier.
result_mac | Output array to store the generated MAC address. |
mac0 | First fixed byte of the MAC address. |
mac1 | Second fixed byte of the MAC address. |
node_id | Unique node identifier used to hash the remaining bytes. |
__NULLABLE__ str_t nyx_base64_encode | ( | __NULLABLE__ size_t * | result_len, |
__ZEROABLE__ size_t | size, | ||
__NULLABLE__ BUFF_t | buff ) |
Encodes a buffer to a Base64-encoded string.
result_len | Optional pointer to store the length of the encoded string. |
size | Size of the buffer to encode. |
buff | Input buffer to encode. |
__NULLABLE__ buff_t nyx_base64_decode | ( | __NULLABLE__ size_t * | result_size, |
__ZEROABLE__ size_t | len, | ||
__NULLABLE__ STR_t | str ) |
Decodes a Base64-encoded string to a buffer.
result_size | Optional pointer to store the size of the decoded buffer. |
len | Length of the string to decode. |
str | Input string to decode. |
uint32_t nyx_hash32 | ( | __ZEROABLE__ size_t | size, |
__NULLABLE__ BUFF_t | buff, | ||
uint32_t | seed ) |
Hashes a buffer using the MurmurHash2 algorithm.
size | Input buffer to hash. |
buff | Length of the buffer to hash. |
seed | Seed. |