# CassUuidGen

### struct CassUuidGen

A UUID generator object.

Instances of the UUID generator object are thread-safe to generate UUIDs. 

### Public Functions

### [CassUuidGen](#_CPPv411CassUuidGen) \*cass_uuid_gen_new()

Creates a new UUID generator.

**Note:** This object is thread-safe. It is best practice to create and reuse a single object per application.

**Note:** If unique node information (IP address) is unable to be determined then random node information will be generated.

#### SEE ALSO
[cass_uuid_gen_free()](#struct_cass_uuid_gen_1a966c9168f66a8b2c02aa872d616a0826)

#### SEE ALSO
[cass_uuid_gen_new_with_node()](#struct_cass_uuid_gen_1aced3f462fff30342b5e3b4b26979b908)

* **Returns:**
  Returns a UUID generator that must be freed.

### [CassUuidGen](#_CPPv411CassUuidGen) \*cass_uuid_gen_new_with_node([cass_uint64_t](https://cpp-rs-driver.docs.scylladb.com/v1.1.0/api/group.BasicTypes.md#_CPPv413cass_uint64_t) node)

Creates a new UUID generator with custom node information.

**Note:** This object is thread-safe. It is best practice to create and reuse a single object per application.

#### SEE ALSO
[cass_uuid_gen_free()](#struct_cass_uuid_gen_1a966c9168f66a8b2c02aa872d616a0826)

* **Returns:**
  Returns a UUID generator that must be freed.

### void cass_uuid_gen_free([CassUuidGen](#_CPPv411CassUuidGen) \*uuid_gen)

Frees a UUID generator instance.

* **Parameters:**
  **uuid_gen** – **[in]** 

### void cass_uuid_gen_time([CassUuidGen](#_CPPv411CassUuidGen) \*uuid_gen, [CassUuid](https://cpp-rs-driver.docs.scylladb.com/v1.1.0/api/struct.CassUuid.md#_CPPv48CassUuid) \*output)

Generates a V1 (time) UUID.

**Note:** This method is thread-safe

* **Parameters:**
  * **uuid_gen** – **[in]** 
  * **output** – **[out]** A V1 UUID for the current time. 

### void cass_uuid_gen_random([CassUuidGen](#_CPPv411CassUuidGen) \*uuid_gen, [CassUuid](https://cpp-rs-driver.docs.scylladb.com/v1.1.0/api/struct.CassUuid.md#_CPPv48CassUuid) \*output)

Generates a new V4 (random) UUID

**Note:**: This method is thread-safe

* **Parameters:**
  * **uuid_gen** – **[in]** 
  * **output** – A randomly generated V4 UUID. 

### void cass_uuid_gen_from_time([CassUuidGen](#_CPPv411CassUuidGen) \*uuid_gen, [cass_uint64_t](https://cpp-rs-driver.docs.scylladb.com/v1.1.0/api/group.BasicTypes.md#_CPPv413cass_uint64_t) timestamp, [CassUuid](https://cpp-rs-driver.docs.scylladb.com/v1.1.0/api/struct.CassUuid.md#_CPPv48CassUuid) \*output)

Generates a V1 (time) UUID for the specified time.

**Note:**: This method is thread-safe

* **Parameters:**
  * **uuid_gen** – **[in]** 
  * **timestamp** – **[in]** 
  * **output** – **[out]** A V1 UUID for the specified time.
