Zephyr API Documentation 4.2.0-rc2
A Scalable Open Source RTOS
 4.2.0-rc2
uuid.h File Reference

Utility functions for the generation and parsing of Universal Unique Identifier. More...

#include <zephyr/kernel.h>
#include <zephyr/types.h>

Go to the source code of this file.

Data Structures

struct  uuid
 Binary representation of a UUID. More...

Macros

#define UUID_SIZE   16U
 Number of bytes in the binary representation of a UUID.
#define UUID_STR_LEN   37U
 Length of the UUID canonical string representation, including the NULL terminator.
#define UUID_BASE64_LEN   25U
 Length of the UUID base64 string representation, including the NULL terminator.
#define UUID_BASE64URL_LEN   23U
 Length of the UUID base64 URL and filename safe string representation, including the NULL terminator.

Functions

int uuid_generate_v4 (struct uuid *out)
 Generate a UUIDv4.
int uuid_generate_v5 (const struct uuid *ns, const void *data, size_t data_size, struct uuid *out)
 Generate a UUIDv5.
int uuid_copy (const struct uuid *data, struct uuid *out)
 Copy an UUID into another UUID.
int uuid_from_buffer (const uint8_t data[16U], struct uuid *out)
 Create a uuid_t from a binary (big-endian) formatted UUID.
int uuid_from_string (const char data[37U], struct uuid *out)
 Parse a UUID from its canonical (RFC9562) string representation.
int uuid_to_buffer (const struct uuid *data, uint8_t out[16U])
 Create a uuid_t from a binary (big-endian) formatted UUID.
int uuid_to_string (const struct uuid *data, char out[37U])
 Convert a UUID to its canonical (RFC9562) string representation.
int uuid_to_base64 (const struct uuid *data, char out[25U])
 Convert a UUID to its base 64 (RFC 3548, RFC 4648) string representation.
int uuid_to_base64url (const struct uuid *data, char out[23U])
 Convert a UUID to its base 64 (RFC 4648 sec.

Detailed Description

Utility functions for the generation and parsing of Universal Unique Identifier.

This driver is compliant with RFC9562: https://datatracker.ietf.org/doc/rfc9562/