This module provides API to create string that is globally unique. If application doesn't require that strong requirement, it can just use pj_create_random_string() instead.
◆ PJ_GUID_MAX_LENGTH
#define PJ_GUID_MAX_LENGTH 36 |
PJ_GUID_MAX_LENGTH specifies the maximum length of GUID string, regardless of which algorithm to use.
◆ pj_create_unique_string()
Generate a unique string.
- Parameters
-
pool | Pool to allocate memory from. |
str | The string. |
◆ pj_create_unique_string_lower()
Generate a unique string in lowercase.
- Parameters
-
pool | Pool to allocate memory from. |
str | The string. |
◆ pj_generate_unique_string()
Create a globally unique string, which length is PJ_GUID_STRING_LENGTH characters. Caller is responsible for preallocating the storage used in the string.
- Parameters
-
str | The string to store the result. |
- Returns
- The string.
◆ pj_generate_unique_string_lower()
Create a globally unique string in lowercase, which length is PJ_GUID_STRING_LENGTH characters. Caller is responsible for preallocating the storage used in the string.
- Parameters
-
str | The string to store the result. |
- Returns
- The string.
◆ pj_GUID_STRING_LENGTH()
unsigned pj_GUID_STRING_LENGTH |
( |
void |
| ) |
|
◆ PJ_GUID_STRING_LENGTH
const unsigned PJ_GUID_STRING_LENGTH |
PJ_GUID_STRING_LENGTH specifies length of GUID string. The value is dependent on the algorithm used internally to generate the GUID string. If real GUID generator is used, then the length will be between 32 and 36 bytes. Application should not assume which algorithm will be used by GUID generator.
Regardless of the actual length of the GUID, it will not exceed PJ_GUID_MAX_LENGTH characters.
- See also
- pj_GUID_STRING_LENGTH()
-
PJ_GUID_MAX_LENGTH