Module zuuid_man

zUUID state manager process.

Description

zUUID state manager process.

This process manages the state of time-based generation data for UUID versions 1, 2 and VI and implements measures to prevent generation of duplicate UUIDs in the case of very high frequency calls to zuuid:v1/0, zuuid:v2/0, zuuid:v2/1, or zuuid:vVI/0.

Starting the zUUID application with zuuid:start/0 is not necessary if only using version 3, 4 or 5 UUIDs, or for using the UUID manipulation functions in the uuid module.

On startup this process will initialize itself with random data for the clock sequence, node/MAC address, posix UID and posix location/GID values. If custom values are desired for any of these state attributes (such as the actual primary MAC address used by the machine, actual posix UID, or some other deliberate identifying data) they can be set after this process has started by using zuuid:config/1.

Data Types

state()

state() = #s{clock_seq = zuuid:clock_seq(), clock_adj = non_neg_integer(), node = zuuid:ieee802mac(), posix_id = zuuid:posix_id(), local_id = zuuid:local_id(), last_v1 = zuuid:uuid(), last_v2 = zuuid:uuid(), last_vVI = zuuid:uuid()}

Function Index

check_offset/0 An explanation and hard-coded test of the magic constant macro ?OFFSET, which defines the difference in nanoseconds between the RFC 4122 accounting date for UUID generation and the beginning of the Unix epoch.
init/1 gen_server callback for startup.

Function Details

check_offset/0

check_offset() -> true

An explanation and hard-coded test of the magic constant macro ?OFFSET, which defines the difference in nanoseconds between the RFC 4122 accounting date for UUID generation and the beginning of the Unix epoch.

init/1

init(X1::term()) -> {ok, state()}

gen_server callback for startup.

zuuid_man initializes every time with a randomized internal state for generation of version 1 and 2 UUIDs. Users are advised to configure the uuid state manager after startup to customize the state if desired.

See also: zuuid:config/1.


Generated by EDoc