http://www.ietf.org/rfc/rfc4122.txt is the reference for official UUIDs.
This implementation provides a version 1 UUID that includes both the
Erlang pid identifier (ID, Serial, Creation) and the distributed Erlang
node name within the 48 bit node ID. To make room for the Erlang pid
identifier, the 48 bits from the MAC address
(i.e., 3 OCI (Organizationally Unique Identifier) bytes and
3 NIC (Network Interface Controller) specific bytes) and
the distributed Erlang node name are bitwise-XORed down to 16 bits.
The Erlang pid is bitwise-XORed from 72 bits down to 32 bits.
The version 3 (MD5), version 4 (random), and version 5 (SHA)
methods are provided as specified within the RFC.
Copyright © 2011-2020 Michael Truog
Version: 1.8.0 Apr 17 2026 10:57:00 ------------------------------------------------------------------------
Authors: Michael Truog (mjtruog at protonmail dot com).
http://www.ietf.org/rfc/rfc4122.txt is the reference for official UUIDs.
This implementation provides a version 1 UUID that includes both the
Erlang pid identifier (ID, Serial, Creation) and the distributed Erlang
node name within the 48 bit node ID. To make room for the Erlang pid
identifier, the 48 bits from the MAC address
(i.e., 3 OCI (Organizationally Unique Identifier) bytes and
3 NIC (Network Interface Controller) specific bytes) and
the distributed Erlang node name are bitwise-XORed down to 16 bits.
The Erlang pid is bitwise-XORed from 72 bits down to 32 bits.
The version 3 (MD5), version 4 (random), and version 5 (SHA)
methods are provided as specified within the RFC.
state() = #uuid_state{variant = v1_variant(), node_id = <<_:48>>, clock_seq = 0..16383, timestamp_type = timestamp_type_internal(), timestamp_last = integer()}
timestamp_type() = erlang | os | warp
timestamp_type_internal() = erlang_timestamp | os | warp
uuid() = <<_:128>>
v1_variant() = rfc4122 | ordered
get_v1_datetime(Value::timestamp_type() | state() | uuid() | erlang:timestamp()) -> string()
get_v1_datetime(Value::timestamp_type() | state() | uuid() | erlang:timestamp(), MicroSecondsOffset::integer()) -> string()
get_v1_time() -> non_neg_integer()
get_v1_time(Uuid_state::timestamp_type() | state() | uuid()) -> non_neg_integer()
get_v3(Data::binary()) -> uuid()
get_v3(Namespace::dns | url | oid | x500 | binary(), Data::binary() | iolist()) -> uuid()
get_v3_compat(Data::binary()) -> uuid()
get_v3_compat(Namespace::dns | url | oid | x500 | binary(), Data::binary() | iolist()) -> uuid()
get_v4() -> uuid()
get_v4(Cache::strong | cached | quickrand_cache:state()) -> uuid() | {uuid(), quickrand_cache:state()}
get_v4_urandom() -> uuid()
get_v5(Data::binary()) -> uuid()
get_v5(Namespace::dns | url | oid | x500 | binary(), Data::binary() | iolist()) -> uuid()
get_v5_compat(Data::binary()) -> uuid()
get_v5_compat(Namespace::dns | url | oid | x500 | binary(), Data::binary() | iolist()) -> uuid()
os or warp timestamp_type is used with a v1 UUID.
The v3, v4 and v5 UUIDs are supported for completeness.
is_uuid(X1::any()) -> boolean()
is_v1(Value::any()) -> boolean()
is_v3(Value::any()) -> boolean()
is_v4(Value::any()) -> boolean()
is_v5(Value::any()) -> boolean()
mac_address() -> [non_neg_integer()]
new(Pid::pid()) -> state()
new(Pid::pid(), Options::timestamp_type() | [{timestamp_type, timestamp_type()} | {mac_address, [non_neg_integer()]} | {variant, v1_variant()}]) -> state()
erlang and os, respectively).
If you want erlang's adjustment of time without enforcement of increasing
time values, use the warp timestamp_type value with Erlang >= 18.0.
string_to_uuid(X1::string() | binary()) -> uuid()
test() -> ok
uuid_to_list(X1::uuid()) -> iolist()
uuid_to_string(Value::uuid()) -> string()
uuid_to_string(Value::uuid(), Option::standard | nodash | list_standard | list_nodash | binary_standard | binary_nodash) -> string() | binary()
Generated by EDoc