UUID generation functions.
More...
|
NUGU_API int | nugu_uuid_convert_base16 (const unsigned char *bytes, size_t bytes_len, char *out, size_t out_len) |
| Convert byte array to base16-encoded string. More...
|
|
NUGU_API int | nugu_uuid_convert_bytes (const char *base16, size_t base16_len, unsigned char *out, size_t out_len) |
| Convert base16-encoded string to byte array. More...
|
|
NUGU_API int | nugu_uuid_convert_msec (const unsigned char *bytes, size_t bytes_len, gint64 *msec) |
| Convert byte array to base16-encoded string. More...
|
|
NUGU_API int | nugu_uuid_fill (gint64 msec, const unsigned char *hash, size_t hash_len, unsigned char *out, size_t out_len) |
| Fill to output buffer with NUGU UUID format using parameters. More...
|
|
NUGU_API int | nugu_uuid_fill_random (unsigned char *dest, size_t dest_len) |
| Generate random bytes and fill to destination buffer. More...
|
|
NUGU_API char * | nugu_uuid_generate_time (void) |
| Generate time based UUID. More...
|
|
UUID generation functions.
◆ NUGU_BASE_TIMESTAMP_MSEC
#define NUGU_BASE_TIMESTAMP_MSEC 1546300800000 |
Milliseconds for base timestamp: 2019/1/1 00:00:00.000 (GMT)
This value must be treated as 64 bits.
◆ nugu_uuid_generate_time()
NUGU_API char* nugu_uuid_generate_time |
( |
void |
| ) |
|
Generate time based UUID.
- Returns
- memory allocated UUID string. Developer must free the data manually.
◆ nugu_uuid_convert_bytes()
NUGU_API int nugu_uuid_convert_bytes |
( |
const char * |
base16, |
|
|
size_t |
base16_len, |
|
|
unsigned char * |
out, |
|
|
size_t |
out_len |
|
) |
| |
Convert base16-encoded string to byte array.
- Parameters
-
[in] | base16 | base16-encoded string |
[in] | base16_len | length |
[out] | out | memory allocated output buffer |
[in] | out_len | size of output buffer |
- Returns
- Result of conversion success or failure
- Return values
-
◆ nugu_uuid_convert_base16()
NUGU_API int nugu_uuid_convert_base16 |
( |
const unsigned char * |
bytes, |
|
|
size_t |
bytes_len, |
|
|
char * |
out, |
|
|
size_t |
out_len |
|
) |
| |
Convert byte array to base16-encoded string.
- Parameters
-
[in] | bytes | byte array |
[in] | bytes_len | length |
[out] | out | memory allocated output buffer |
[in] | out_len | size of output buffer |
- Returns
- Result of conversion success or failure
- Return values
-
◆ nugu_uuid_convert_msec()
NUGU_API int nugu_uuid_convert_msec |
( |
const unsigned char * |
bytes, |
|
|
size_t |
bytes_len, |
|
|
gint64 * |
msec |
|
) |
| |
Convert byte array to base16-encoded string.
- Parameters
-
[in] | bytes | byte array |
[in] | bytes_len | length |
[out] | msec | milliseconds |
- Returns
- Result of conversion success or failure
- Return values
-
◆ nugu_uuid_fill_random()
NUGU_API int nugu_uuid_fill_random |
( |
unsigned char * |
dest, |
|
|
size_t |
dest_len |
|
) |
| |
Generate random bytes and fill to destination buffer.
- Parameters
-
[in] | dest | destination buffer |
[in] | dest_len | length of buffer |
- Returns
- Result
- Return values
-
◆ nugu_uuid_fill()
NUGU_API int nugu_uuid_fill |
( |
gint64 |
msec, |
|
|
const unsigned char * |
hash, |
|
|
size_t |
hash_len, |
|
|
unsigned char * |
out, |
|
|
size_t |
out_len |
|
) |
| |
Fill to output buffer with NUGU UUID format using parameters.
- Parameters
-
[in] | msec | milliseconds |
[in] | hash | hash value(e.g. SHA1(token)) |
[in] | hash_len | length of hash value |
[out] | out | memory allocated output buffer |
[in] | out_len | size of output buffer |
- Returns
- Result
- Return values
-