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.
The ordered version 1 variant is not present in the RFC, though it is the most standards-compliant way of providing timestamp UUID ordering.Copyright © 2011-2020 Michael Truog
Version: 2.0.1 Nov 26 2020 14:44:38 ------------------------------------------------------------------------
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.
The ordered version 1 variant is not present in the RFC, though it is the most standards-compliant way of providing timestamp UUID ordering. Timestamp ordering has been used in many non-standard UUID formats based on version 1 and typically limited to the same data present in the version 1 UUID (e.g., "Version 6" at http://gh.peabody.io/uuidv6/).iso8601() = [48..57 | 84 | 45 | 58 | 46 | 90, ...]
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>>
uuid_string() = uuid_string_list() | uuid_string_binary()
uuid_string_binary() = <<_:256>> | <<_:288>>
uuid_string_list() = [48..57 | 97..102 | 45, ...]
v1_variant() = rfc4122 | ordered
get_v1_datetime(Value::timestamp_type() | state() | uuid() | erlang:timestamp()) -> iso8601()
get_v1_datetime(Value::timestamp_type() | state() | uuid() | erlang:timestamp(), MicroSecondsOffset::integer()) -> iso8601()
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::iodata()) -> uuid()
get_v3_compat(Data::binary()) -> uuid()
get_v3_compat(Namespace::dns | url | oid | x500 | binary(), Data::iodata()) -> 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::iodata()) -> uuid()
get_v5_compat(Data::binary()) -> uuid()
get_v5_compat(Namespace::dns | url | oid | x500 | binary(), Data::iodata()) -> 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::uuid_string()) -> uuid()
test() -> ok
uuid_to_list(X1::uuid()) -> [non_neg_integer(), ...]
uuid_to_string(Value::uuid()) -> uuid_string_list()
uuid_to_string(Value::uuid(), Option::standard | nodash | list_standard | list_nodash | binary_standard | binary_nodash) -> uuid_string()
Generated by EDoc