1 <?xml version='
1.0'
?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
6 SPDX-License-Identifier: LGPL-2.1+
9 <refentry id=
"sd_id128_randomize" xmlns:
xi=
"http://www.w3.org/2001/XInclude">
12 <title>sd_id128_randomize
</title>
13 <productname>systemd
</productname>
17 <refentrytitle>sd_id128_randomize
</refentrytitle>
18 <manvolnum>3</manvolnum>
22 <refname>sd_id128_randomize
</refname>
23 <refpurpose>Generate
128-bit IDs
</refpurpose>
28 <funcsynopsisinfo>#include
<systemd/sd-id128.h
></funcsynopsisinfo>
31 <funcdef>int
<function>sd_id128_randomize
</function></funcdef>
32 <paramdef>sd_id128_t *
<parameter>ret
</parameter></paramdef>
39 <title>Description
</title>
41 <para><function>sd_id128_randomize()
</function> generates a new
42 randomized
128-bit ID and returns it in
43 <parameter>ret
</parameter>. Every invocation returns a new
44 randomly generated ID. This uses the
45 <filename>/dev/urandom
</filename> kernel random number
48 <para>Note that
<function>sd_id128_randomize()
</function> always
49 returns a UUID v4-compatible ID.
</para>
51 <para>For more information about the
<literal>sd_id128_t
</literal>
53 <citerefentry><refentrytitle>sd-id128
</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
</para>
55 <para><citerefentry><refentrytitle>journalctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
56 <option>--new-id128
</option> option may be used as a command line
57 front-end for
<function>sd_id128_randomize()
</function>.
</para>
61 <title>Return Value
</title>
63 <para>The call returns
0 on success (in which case
64 <parameter>ret
</parameter> is filled in), or a negative
65 errno-style error code.
</para>
68 <xi:include href=
"libsystemd-pkgconfig.xml" />
71 <title>See Also
</title>
74 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
75 <citerefentry><refentrytitle>sd-id128
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
76 <citerefentry><refentrytitle>machine-id
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
77 <citerefentry><refentrytitle>random
</refentrytitle><manvolnum>4</manvolnum></citerefentry>,
78 <citerefentry><refentrytitle>sd_id128_get_machine
</refentrytitle><manvolnum>3</manvolnum></citerefentry>