API/UUID: Difference between revisions
Jump to navigation
Jump to search
imported>OCDoc Import Imported from legacy OpenComputers documentation at ocdoc.cil.li |
Clean up Markdown artifacts from DokuWiki migration |
||
| Line 9: | Line 9: | ||
<pre>Returns 128 bit random identifiers, represented as a hex value in a string grouped by 8, 4, 4, 4, and 12 hex characters, separated by dashes. | <pre>Returns 128 bit random identifiers, represented as a hex value in a string grouped by 8, 4, 4, 4, and 12 hex characters, separated by dashes. | ||
</pre> | </pre> | ||
<pre>e.g. | <pre>e.g. 34eb7b28-14d3-4767-b326-dd1609ba92e. You might recognize this pattern as it is the same used for component addressing. | ||
</pre> | </pre> | ||
<syntaxhighlight lang="lua"> | |||
print(require("uuid").next()) | |||
</syntaxhighlight> | |||
== Contents == | == Contents == | ||
{{:API/contents}} | {{:API/contents}} | ||
Latest revision as of 20:27, 24 August 2026
UUID API
(new in OpenOS 1.6)
The uuid API is a very simple library for creating 128 bit random identifiers.
uuid.next() string
Returns 128 bit random identifiers, represented as a hex value in a string grouped by 8, 4, 4, 4, and 12 hex characters, separated by dashes.
e.g. 34eb7b28-14d3-4767-b326-dd1609ba92e. You might recognize this pattern as it is the same used for component addressing.
print(require("uuid").next())Contents
| APIs | |
|---|---|
| OpenOS | buffer - colors - component - computer - event - filesystem - uuid - internet - keyboard - note - process - rc - robot - serialization - shell - sides - term - text - thread - transforms - unicode |
| Lua Libraries | coroutine - package - io - os |