BLOG | DOCUMENTATION | TRAC

Home --> Documentations --> PJLIB Reference

Globally Unique Identifier

Macros

#define PJ_GUID_MAX_LENGTH   36
 

Functions

unsigned pj_GUID_STRING_LENGTH (void)
 
pj_str_tpj_generate_unique_string (pj_str_t *str)
 
pj_str_tpj_generate_unique_string_lower (pj_str_t *str)
 
void pj_create_unique_string (pj_pool_t *pool, pj_str_t *str)
 
void pj_create_unique_string_lower (pj_pool_t *pool, pj_str_t *str)
 

Variables

const unsigned PJ_GUID_STRING_LENGTH
 

Detailed Description

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.

Macro Definition Documentation

◆ 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.

Function Documentation

◆ pj_create_unique_string()

void pj_create_unique_string ( pj_pool_t pool,
pj_str_t str 
)

Generate a unique string.

Parameters
poolPool to allocate memory from.
strThe string.

◆ pj_create_unique_string_lower()

void pj_create_unique_string_lower ( pj_pool_t pool,
pj_str_t str 
)

Generate a unique string in lowercase.

Parameters
poolPool to allocate memory from.
strThe string.

◆ pj_generate_unique_string()

pj_str_t* pj_generate_unique_string ( pj_str_t str)

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
strThe string to store the result.
Returns
The string.

◆ pj_generate_unique_string_lower()

pj_str_t* pj_generate_unique_string_lower ( pj_str_t str)

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
strThe string to store the result.
Returns
The string.

◆ pj_GUID_STRING_LENGTH()

unsigned pj_GUID_STRING_LENGTH ( void  )

Get PJ_GUID_STRING_LENGTH constant.

Variable Documentation

◆ 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

 


PJLIB Open Source, high performance, small footprint, and very very portable framework
Copyright (C) 2006-2009 Teluu Inc.