Menu

CassUuidGen

struct CassUuidGen

A UUID generator object.

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

Public Functions

CassUuidGen *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.

Return

Returns a UUID generator that must be freed.

See

cass_uuid_gen_free()

See

cass_uuid_gen_new_with_node()

CassUuidGen *cass_uuid_gen_new_with_node(cass_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.

Return

Returns a UUID generator that must be freed.

See

cass_uuid_gen_free()

void cass_uuid_gen_free(CassUuidGen *uuid_gen)

Frees a UUID generator instance.

Parameters
  • uuid_gen:

void cass_uuid_gen_time(CassUuidGen *uuid_gen, CassUuid *output)

Generates a V1 (time) UUID.

Note: This method is thread-safe

Parameters
  • uuid_gen:

  • output: A V1 UUID for the current time.

void cass_uuid_gen_random(CassUuidGen *uuid_gen, CassUuid *output)

Generates a new V4 (random) UUID

Note:: This method is thread-safe

Parameters
  • uuid_gen:

  • output: A randomly generated V4 UUID.

void cass_uuid_gen_from_time(CassUuidGen *uuid_gen, cass_uint64_t timestamp, CassUuid *output)

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

Note:: This method is thread-safe

Parameters
  • uuid_gen:

  • timestamp:

  • output: A V1 UUID for the specified time.