Current section

Files

Jump to
uuid_erl doc uuid.html
Raw

doc/uuid.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Module uuid</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
</head>
<body bgcolor="white">
<div class="navbar"><a name="#navbar_top"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<hr>
<h1>Module uuid</h1>
<ul class="index"><li><a href="#description">Description</a></li><li><a href="#types">Data Types</a></li><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>
<h3><a name="Erlang_UUID_Generation">Erlang UUID Generation</a></h3><p>
<a href="http://www.ietf.org/rfc/rfc4122.txt" target="_top"><tt>http://www.ietf.org/rfc/rfc4122.txt</tt></a> 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.</p>
The ordered version 1 variant is not present in the RFC,
though it is the most standards-compliant way of providing
timestamp UUID ordering.
<p>Copyright © 2011-2023 Michael Truog</p>
<p><b>Version:</b> 2.0.6 Jun 20 2023 18:00:26
------------------------------------------------------------------------</p>
<p><b>Authors:</b> Michael Truog (<a href="mailto:mjtruog at protonmail dot com"><tt>mjtruog at protonmail dot com</tt></a>).</p>
<h2><a name="description">Description</a></h2>
<h3><a name="Erlang_UUID_Generation">Erlang UUID Generation</a></h3><p>
<a href="http://www.ietf.org/rfc/rfc4122.txt" target="_top"><tt>http://www.ietf.org/rfc/rfc4122.txt</tt></a> 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.</p>
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/).
<h2><a name="types">Data Types</a></h2>
<h3 class="typedecl"><a name="type-iso8601">iso8601()</a></h3>
<p><tt>iso8601() = [48..57 | 84 | 45 | 58 | 46 | 90, ...]</tt></p>
<h3 class="typedecl"><a name="type-state">state()</a></h3>
<p><tt>state() = #uuid_state{variant = <a href="#type-v1_variant">v1_variant()</a>, node_id = &lt;&lt;_:48&gt;&gt;, clock_seq = 0..16383, timestamp_type = <a href="#type-timestamp_type_internal">timestamp_type_internal()</a>, timestamp_last = integer()}</tt></p>
<h3 class="typedecl"><a name="type-timestamp_type">timestamp_type()</a></h3>
<p><tt>timestamp_type() = erlang | os | warp</tt></p>
<h3 class="typedecl"><a name="type-timestamp_type_internal">timestamp_type_internal()</a></h3>
<p><tt>timestamp_type_internal() = erlang_timestamp | os | warp</tt></p>
<h3 class="typedecl"><a name="type-uuid">uuid()</a></h3>
<p><tt>uuid() = &lt;&lt;_:128&gt;&gt;</tt></p>
<h3 class="typedecl"><a name="type-uuid_string">uuid_string()</a></h3>
<p><tt>uuid_string() = <a href="#type-uuid_string_list">uuid_string_list()</a> | <a href="#type-uuid_string_binary">uuid_string_binary()</a></tt></p>
<h3 class="typedecl"><a name="type-uuid_string_binary">uuid_string_binary()</a></h3>
<p><tt>uuid_string_binary() = &lt;&lt;_:256&gt;&gt; | &lt;&lt;_:288&gt;&gt;</tt></p>
<h3 class="typedecl"><a name="type-uuid_string_list">uuid_string_list()</a></h3>
<p><tt>uuid_string_list() = [48..57 | 97..102 | 45, ...]</tt></p>
<h3 class="typedecl"><a name="type-v1_variant">v1_variant()</a></h3>
<p><tt>v1_variant() = rfc4122 | ordered</tt></p>
<h2><a name="index">Function Index</a></h2>
<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#get_v1-1">get_v1/1</a></td><td>
<h4><a name="Get_a_v1_UUID.">Get a v1 UUID.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#get_v1_datetime-1">get_v1_datetime/1</a></td><td>
<h4><a name="Get_an_ISO8601_datetime_in_UTC_from_a_v1_UUID's_time_value.">Get an ISO8601 datetime in UTC from a v1 UUID's time value.</a></h4>
http://www.w3.org/TR/NOTE-datetime.</td></tr>
<tr><td valign="top"><a href="#get_v1_datetime-2">get_v1_datetime/2</a></td><td>
<h4><a name="Get_an_ISO8601_datetime_in_UTC_from_a_v1_UUID's_time_value_with_an_offset_in_microseconds.">Get an ISO8601 datetime in UTC from a v1 UUID's time value with an offset in microseconds.</a></h4>
http://www.w3.org/TR/NOTE-datetime.</td></tr>
<tr><td valign="top"><a href="#get_v1_time-0">get_v1_time/0</a></td><td>
<h4><a name="Get_the_current_time_value_in_a_manner_consistent_with_the_v1_UUID.">Get the current time value in a manner consistent with the v1 UUID.</a></h4>
The result is an integer in microseconds since the UNIX epoch.</td></tr>
<tr><td valign="top"><a href="#get_v1_time-1">get_v1_time/1</a></td><td>
<h4><a name="Get_the_current_time_value_in_a_manner_consistent_with_the_v1_UUID.">Get the current time value in a manner consistent with the v1 UUID.</a></h4>
The result is an integer in microseconds since the UNIX epoch.</td></tr>
<tr><td valign="top"><a href="#get_v1_time_ns-0">get_v1_time_ns/0</a></td><td>
<h4><a name="Get_the_current_time_value_in_a_manner_consistent_with_the_v1_UUID.">Get the current time value in a manner consistent with the v1 UUID.</a></h4>
The result is an integer in nanoseconds since the UNIX epoch.</td></tr>
<tr><td valign="top"><a href="#get_v1_time_ns-1">get_v1_time_ns/1</a></td><td>
<h4><a name="Get_the_current_time_value_in_a_manner_consistent_with_the_v1_UUID.">Get the current time value in a manner consistent with the v1 UUID.</a></h4>
The result is an integer in nanoseconds since the UNIX epoch.</td></tr>
<tr><td valign="top"><a href="#get_v3-1">get_v3/1</a></td><td>
<h4><a name="Get_a_v3_UUID.">Get a v3 UUID.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#get_v3-2">get_v3/2</a></td><td>
<h4><a name="Get_a_v3_UUID_in_a_particular_namespace.">Get a v3 UUID in a particular namespace.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#get_v3_compat-1">get_v3_compat/1</a></td><td>
<h4><a name="Get_a_compatible_v3_UUID.">Get a compatible v3 UUID.</a></h4>
Do not use all bits from the checksum so that the UUID matches external
implementations.</td></tr>
<tr><td valign="top"><a href="#get_v3_compat-2">get_v3_compat/2</a></td><td>
<h4><a name="Get_a_compatible_v3_UUID_in_a_particular_namespace.">Get a compatible v3 UUID in a particular namespace.</a></h4>
Do not use all bits from the checksum so that the UUID matches external
implementations.</td></tr>
<tr><td valign="top"><a href="#get_v4-0">get_v4/0</a></td><td>
<h4><a name="Get_a_v4_UUID_(using_crypto/openssl).">Get a v4 UUID (using crypto/openssl).</a></h4>
crypto:strong_rand_bytes/1 repeats in the same way as
RAND_bytes within OpenSSL.</td></tr>
<tr><td valign="top"><a href="#get_v4-1">get_v4/1</a></td><td></td></tr>
<tr><td valign="top"><a href="#get_v4_urandom-0">get_v4_urandom/0</a></td><td>
<h4><a name="Get_a_v4_UUID_(using_a_256-bit_Marsaglia_multiply-with-carry_PRNG).">Get a v4 UUID (using a 256-bit Marsaglia multiply-with-carry PRNG).</a></h4>
quickrand:mwc256_128/1 repeats every 5.79e76 (2^255) approx.</td></tr>
<tr><td valign="top"><a href="#get_v5-1">get_v5/1</a></td><td>
<h4><a name="Get_a_v5_UUID.">Get a v5 UUID.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#get_v5-2">get_v5/2</a></td><td>
<h4><a name="Get_a_v5_UUID_in_a_particular_namespace.">Get a v5 UUID in a particular namespace.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#get_v5_compat-1">get_v5_compat/1</a></td><td>
<h4><a name="Get_a_compatible_v5_UUID.">Get a compatible v5 UUID.</a></h4>
Do not use all bits from the checksum so that the UUID matches external
implementations.</td></tr>
<tr><td valign="top"><a href="#get_v5_compat-2">get_v5_compat/2</a></td><td>
<h4><a name="Get_a_compatible_v5_UUID_in_a_particular_namespace.">Get a compatible v5 UUID in a particular namespace.</a></h4>
Do not use all bits from the checksum so that the UUID matches external
implementations.</td></tr>
<tr><td valign="top"><a href="#increment-1">increment/1</a></td><td>
<h4><a name="Increment_the_clock_sequence_of_v1_UUID_state_or_a_UUID.">Increment the clock sequence of v1 UUID state or a UUID.</a></h4>
Call to increment the clock sequence counter after the system clock has
been set backwards (see the RFC).</td></tr>
<tr><td valign="top"><a href="#is_uuid-1">is_uuid/1</a></td><td>
<h4><a name="Is_the_term_a_UUID?">Is the term a UUID?</a></h4>.</td></tr>
<tr><td valign="top"><a href="#is_v1-1">is_v1/1</a></td><td>
<h4><a name="Is_the_binary_a_v1_UUID?">Is the binary a v1 UUID?</a></h4>.</td></tr>
<tr><td valign="top"><a href="#is_v3-1">is_v3/1</a></td><td>
<h4><a name="Is_the_binary_a_v3_UUID?">Is the binary a v3 UUID?</a></h4>.</td></tr>
<tr><td valign="top"><a href="#is_v4-1">is_v4/1</a></td><td>
<h4><a name="Is_the_binary_a_v4_UUID?">Is the binary a v4 UUID?</a></h4>.</td></tr>
<tr><td valign="top"><a href="#is_v5-1">is_v5/1</a></td><td>
<h4><a name="Is_the_binary_a_v5_UUID?">Is the binary a v5 UUID?</a></h4>.</td></tr>
<tr><td valign="top"><a href="#mac_address-0">mac_address/0</a></td><td>
<h4><a name="Provide_a_usable_network_interface_MAC_address.">Provide a usable network interface MAC address.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#new-1">new/1</a></td><td>
<h4><a name="Create_new_UUID_state_for_v1_UUID_generation.">Create new UUID state for v1 UUID generation.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#new-2">new/2</a></td><td>
<h4><a name="Create_new_UUID_state_for_v1_UUID_generation_using_a_specific_type_of_timestamp.">Create new UUID state for v1 UUID generation using a specific type of timestamp.</a></h4>
The timestamp can either be based on erlang's adjustment of time
(for only strictly monotonically increasing time values) or the
operating system's time without any adjustment
(with timestamp_type values <code>erlang</code> and <code>os</code>, respectively).</td></tr>
<tr><td valign="top"><a href="#string_to_uuid-1">string_to_uuid/1</a></td><td>
<h4><a name="Convert_a_string_representation_to_a_UUID.">Convert a string representation to a UUID.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#test-0">test/0</a></td><td>
<h4><a name="Regression_test.">Regression test.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#uuid_to_list-1">uuid_to_list/1</a></td><td>
<h4><a name="Convert_a_UUID_to_a_list.">Convert a UUID to a list.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#uuid_to_string-1">uuid_to_string/1</a></td><td>
<h4><a name="Convert_a_UUID_to_a_string_representation.">Convert a UUID to a string representation.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#uuid_to_string-2">uuid_to_string/2</a></td><td>
<h4><a name="Convert_a_UUID_to_a_string_representation_based_on_an_option.">Convert a UUID to a string representation based on an option.</a></h4>.</td></tr>
</table>
<h2><a name="functions">Function Details</a></h2>
<h3 class="function"><a name="get_v1-1">get_v1/1</a></h3>
<div class="spec">
<p><tt>get_v1(State::<a href="#type-state">state()</a>) -&gt; {<a href="#type-uuid">uuid()</a>, StateNew::<a href="#type-state">state()</a>}</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Get_a_v1_UUID.">Get a v1 UUID.</a></h4>
</p>
<h3 class="function"><a name="get_v1_datetime-1">get_v1_datetime/1</a></h3>
<div class="spec">
<p><tt>get_v1_datetime(Value::<a href="#type-timestamp_type">timestamp_type()</a> | <a href="#type-state">state()</a> | <a href="#type-uuid">uuid()</a> | <a href="/home/george/organized/work/erlang/erts/doc/erlang.html#type-timestamp">erlang:timestamp()</a>) -&gt; <a href="#type-iso8601">iso8601()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Get_an_ISO8601_datetime_in_UTC_from_a_v1_UUID's_time_value.">Get an ISO8601 datetime in UTC from a v1 UUID's time value.</a></h4>
http://www.w3.org/TR/NOTE-datetime</p>
<h3 class="function"><a name="get_v1_datetime-2">get_v1_datetime/2</a></h3>
<div class="spec">
<p><tt>get_v1_datetime(Value::<a href="#type-timestamp_type">timestamp_type()</a> | <a href="#type-state">state()</a> | <a href="#type-uuid">uuid()</a> | <a href="/home/george/organized/work/erlang/erts/doc/erlang.html#type-timestamp">erlang:timestamp()</a>, MicroSecondsOffset::integer()) -&gt; <a href="#type-iso8601">iso8601()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Get_an_ISO8601_datetime_in_UTC_from_a_v1_UUID's_time_value_with_an_offset_in_microseconds.">Get an ISO8601 datetime in UTC from a v1 UUID's time value with an offset in microseconds.</a></h4>
http://www.w3.org/TR/NOTE-datetime</p>
<h3 class="function"><a name="get_v1_time-0">get_v1_time/0</a></h3>
<div class="spec">
<p><tt>get_v1_time() -&gt; non_neg_integer()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Get_the_current_time_value_in_a_manner_consistent_with_the_v1_UUID.">Get the current time value in a manner consistent with the v1 UUID.</a></h4>
The result is an integer in microseconds since the UNIX epoch.
(The UNIX epoch is 1970-01-01T00:00:00Z)</p>
<h3 class="function"><a name="get_v1_time-1">get_v1_time/1</a></h3>
<div class="spec">
<p><tt>get_v1_time(Value::<a href="#type-timestamp_type">timestamp_type()</a> | <a href="#type-state">state()</a> | <a href="#type-uuid">uuid()</a>) -&gt; non_neg_integer()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Get_the_current_time_value_in_a_manner_consistent_with_the_v1_UUID.">Get the current time value in a manner consistent with the v1 UUID.</a></h4>
The result is an integer in microseconds since the UNIX epoch.
(The UNIX epoch is 1970-01-01T00:00:00Z)</p>
<h3 class="function"><a name="get_v1_time_ns-0">get_v1_time_ns/0</a></h3>
<div class="spec">
<p><tt>get_v1_time_ns() -&gt; non_neg_integer()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Get_the_current_time_value_in_a_manner_consistent_with_the_v1_UUID.">Get the current time value in a manner consistent with the v1 UUID.</a></h4>
The result is an integer in nanoseconds since the UNIX epoch.
(The UNIX epoch is 1970-01-01T00:00:00Z)</p>
<h3 class="function"><a name="get_v1_time_ns-1">get_v1_time_ns/1</a></h3>
<div class="spec">
<p><tt>get_v1_time_ns(Uuid_state::<a href="#type-timestamp_type">timestamp_type()</a> | <a href="#type-state">state()</a> | <a href="#type-uuid">uuid()</a>) -&gt; non_neg_integer()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Get_the_current_time_value_in_a_manner_consistent_with_the_v1_UUID.">Get the current time value in a manner consistent with the v1 UUID.</a></h4>
The result is an integer in nanoseconds since the UNIX epoch.
(The UNIX epoch is 1970-01-01T00:00:00Z)</p>
<h3 class="function"><a name="get_v3-1">get_v3/1</a></h3>
<div class="spec">
<p><tt>get_v3(Data::binary()) -&gt; <a href="#type-uuid">uuid()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Get_a_v3_UUID.">Get a v3 UUID.</a></h4>
</p>
<h3 class="function"><a name="get_v3-2">get_v3/2</a></h3>
<div class="spec">
<p><tt>get_v3(Namespace::dns | url | oid | x500 | binary(), Data::iodata()) -&gt; <a href="#type-uuid">uuid()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Get_a_v3_UUID_in_a_particular_namespace.">Get a v3 UUID in a particular namespace.</a></h4>
</p>
<h3 class="function"><a name="get_v3_compat-1">get_v3_compat/1</a></h3>
<div class="spec">
<p><tt>get_v3_compat(Data::binary()) -&gt; <a href="#type-uuid">uuid()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Get_a_compatible_v3_UUID.">Get a compatible v3 UUID.</a></h4>
Do not use all bits from the checksum so that the UUID matches external
implementations.</p>
<h3 class="function"><a name="get_v3_compat-2">get_v3_compat/2</a></h3>
<div class="spec">
<p><tt>get_v3_compat(Namespace::dns | url | oid | x500 | binary(), Data::iodata()) -&gt; <a href="#type-uuid">uuid()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Get_a_compatible_v3_UUID_in_a_particular_namespace.">Get a compatible v3 UUID in a particular namespace.</a></h4>
Do not use all bits from the checksum so that the UUID matches external
implementations.</p>
<h3 class="function"><a name="get_v4-0">get_v4/0</a></h3>
<div class="spec">
<p><tt>get_v4() -&gt; <a href="#type-uuid">uuid()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Get_a_v4_UUID_(using_crypto/openssl).">Get a v4 UUID (using crypto/openssl).</a></h4>
crypto:strong_rand_bytes/1 repeats in the same way as
RAND_bytes within OpenSSL.</p>
<h3 class="function"><a name="get_v4-1">get_v4/1</a></h3>
<div class="spec">
<p><tt>get_v4(Cache::strong | cached | <a href="deps/quickrand/doc/quickrand_cache.html#type-state">quickrand_cache:state()</a>) -&gt; <a href="#type-uuid">uuid()</a> | {<a href="#type-uuid">uuid()</a>, <a href="deps/quickrand/doc/quickrand_cache.html#type-state">quickrand_cache:state()</a>}</tt><br></p>
<p> </p>
</div>
<h3 class="function"><a name="get_v4_urandom-0">get_v4_urandom/0</a></h3>
<div class="spec">
<p><tt>get_v4_urandom() -&gt; <a href="#type-uuid">uuid()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Get_a_v4_UUID_(using_a_256-bit_Marsaglia_multiply-with-carry_PRNG).">Get a v4 UUID (using a 256-bit Marsaglia multiply-with-carry PRNG).</a></h4>
quickrand:mwc256_128/1 repeats every 5.79e76 (2^255) approx.
(see quickrand.erl for details)</p>
<h3 class="function"><a name="get_v5-1">get_v5/1</a></h3>
<div class="spec">
<p><tt>get_v5(Data::binary()) -&gt; <a href="#type-uuid">uuid()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Get_a_v5_UUID.">Get a v5 UUID.</a></h4>
</p>
<h3 class="function"><a name="get_v5-2">get_v5/2</a></h3>
<div class="spec">
<p><tt>get_v5(Namespace::dns | url | oid | x500 | binary(), Data::iodata()) -&gt; <a href="#type-uuid">uuid()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Get_a_v5_UUID_in_a_particular_namespace.">Get a v5 UUID in a particular namespace.</a></h4>
</p>
<h3 class="function"><a name="get_v5_compat-1">get_v5_compat/1</a></h3>
<div class="spec">
<p><tt>get_v5_compat(Data::binary()) -&gt; <a href="#type-uuid">uuid()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Get_a_compatible_v5_UUID.">Get a compatible v5 UUID.</a></h4>
Do not use all bits from the checksum so that the UUID matches external
implementations.</p>
<h3 class="function"><a name="get_v5_compat-2">get_v5_compat/2</a></h3>
<div class="spec">
<p><tt>get_v5_compat(Namespace::dns | url | oid | x500 | binary(), Data::iodata()) -&gt; <a href="#type-uuid">uuid()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Get_a_compatible_v5_UUID_in_a_particular_namespace.">Get a compatible v5 UUID in a particular namespace.</a></h4>
Do not use all bits from the checksum so that the UUID matches external
implementations.</p>
<h3 class="function"><a name="increment-1">increment/1</a></h3>
<div class="spec">
<p><tt>increment(Uuid_state::<a href="#type-state">state()</a> | <a href="#type-uuid">uuid()</a>) -&gt; <a href="#type-state">state()</a> | <a href="#type-uuid">uuid()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Increment_the_clock_sequence_of_v1_UUID_state_or_a_UUID.">Increment the clock sequence of v1 UUID state or a UUID.</a></h4>
Call to increment the clock sequence counter after the system clock has
been set backwards (see the RFC). This is only necessary
if the <code>os</code> or <code>warp</code> timestamp_type is used with a v1 UUID.
The v3, v4 and v5 UUIDs are supported for completeness.</p>
<h3 class="function"><a name="is_uuid-1">is_uuid/1</a></h3>
<div class="spec">
<p><tt>is_uuid(X1::any()) -&gt; boolean()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Is_the_term_a_UUID?">Is the term a UUID?</a></h4>
</p>
<h3 class="function"><a name="is_v1-1">is_v1/1</a></h3>
<div class="spec">
<p><tt>is_v1(Value::any()) -&gt; boolean()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Is_the_binary_a_v1_UUID?">Is the binary a v1 UUID?</a></h4>
</p>
<h3 class="function"><a name="is_v3-1">is_v3/1</a></h3>
<div class="spec">
<p><tt>is_v3(Value::any()) -&gt; boolean()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Is_the_binary_a_v3_UUID?">Is the binary a v3 UUID?</a></h4>
</p>
<h3 class="function"><a name="is_v4-1">is_v4/1</a></h3>
<div class="spec">
<p><tt>is_v4(Value::any()) -&gt; boolean()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Is_the_binary_a_v4_UUID?">Is the binary a v4 UUID?</a></h4>
</p>
<h3 class="function"><a name="is_v5-1">is_v5/1</a></h3>
<div class="spec">
<p><tt>is_v5(Value::any()) -&gt; boolean()</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Is_the_binary_a_v5_UUID?">Is the binary a v5 UUID?</a></h4>
</p>
<h3 class="function"><a name="mac_address-0">mac_address/0</a></h3>
<div class="spec">
<p><tt>mac_address() -&gt; [non_neg_integer(), ...]</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Provide_a_usable_network_interface_MAC_address.">Provide a usable network interface MAC address.</a></h4>
</p>
<h3 class="function"><a name="new-1">new/1</a></h3>
<div class="spec">
<p><tt>new(Pid::pid()) -&gt; <a href="#type-state">state()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Create_new_UUID_state_for_v1_UUID_generation.">Create new UUID state for v1 UUID generation.</a></h4>
</p>
<h3 class="function"><a name="new-2">new/2</a></h3>
<div class="spec">
<p><tt>new(Pid::pid(), Options::<a href="#type-timestamp_type">timestamp_type()</a> | [{timestamp_type, <a href="#type-timestamp_type">timestamp_type()</a>} | {mac_address, [non_neg_integer()]} | {variant, <a href="#type-v1_variant">v1_variant()</a>}]) -&gt; <a href="#type-state">state()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Create_new_UUID_state_for_v1_UUID_generation_using_a_specific_type_of_timestamp.">Create new UUID state for v1 UUID generation using a specific type of timestamp.</a></h4>
The timestamp can either be based on erlang's adjustment of time
(for only strictly monotonically increasing time values) or the
operating system's time without any adjustment
(with timestamp_type values <code>erlang</code> and <code>os</code>, respectively).
If you want erlang's adjustment of time without enforcement of increasing
time values, use the <code>warp</code> timestamp_type value with Erlang &gt;= 18.0.</p>
<h3 class="function"><a name="string_to_uuid-1">string_to_uuid/1</a></h3>
<div class="spec">
<p><tt>string_to_uuid(X1::<a href="#type-uuid_string">uuid_string()</a>) -&gt; <a href="#type-uuid">uuid()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Convert_a_string_representation_to_a_UUID.">Convert a string representation to a UUID.</a></h4>
</p>
<h3 class="function"><a name="test-0">test/0</a></h3>
<div class="spec">
<p><tt>test() -&gt; ok</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Regression_test.">Regression test.</a></h4>
</p>
<h3 class="function"><a name="uuid_to_list-1">uuid_to_list/1</a></h3>
<div class="spec">
<p><tt>uuid_to_list(X1::<a href="#type-uuid">uuid()</a>) -&gt; [non_neg_integer(), ...]</tt><br></p>
<p> </p>
</div><p>
<h4><a name="Convert_a_UUID_to_a_list.">Convert a UUID to a list.</a></h4>
</p>
<h3 class="function"><a name="uuid_to_string-1">uuid_to_string/1</a></h3>
<div class="spec">
<p><tt>uuid_to_string(Value::<a href="#type-uuid">uuid()</a>) -&gt; <a href="#type-uuid_string_list">uuid_string_list()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Convert_a_UUID_to_a_string_representation.">Convert a UUID to a string representation.</a></h4>
</p>
<h3 class="function"><a name="uuid_to_string-2">uuid_to_string/2</a></h3>
<div class="spec">
<p><tt>uuid_to_string(Value::<a href="#type-uuid">uuid()</a>, Option::standard | nodash | list_standard | list_nodash | binary_standard | binary_nodash) -&gt; <a href="#type-uuid_string">uuid_string()</a></tt><br></p>
<p> </p>
</div><p>
<h4><a name="Convert_a_UUID_to_a_string_representation_based_on_an_option.">Convert a UUID to a string representation based on an option.</a></h4>
</p>
<hr>
<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<p><i>Generated by EDoc</i></p>
</body>
</html>