API/UUID/zh: Difference between revisions

From OpenComputers: Rebooted
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>返回128位随机标识码,以16进制数值的字符串形式表示,按照8,4,4,4,12的模式分组,中间用破折号分开。
<pre>返回128位随机标识码,以16进制数值的字符串形式表示,按照8,4,4,4,12的模式分组,中间用破折号分开。
</pre>
</pre>
<pre>例如:`34eb7b28-14d3-4767-b326-dd1609ba92e`。你可能会发现组件地址也使用了同样的模式。
<pre>例如:34eb7b28-14d3-4767-b326-dd1609ba92e。你可能会发现组件地址也使用了同样的模式。
</pre>
</pre>
```lua print(require("uuid").next()) ```
<syntaxhighlight lang="lua">
print(require("uuid").next())
</syntaxhighlight>


== 目录 ==
== 目录 ==


{{:API/contents/zh}}
{{:API/contents/zh}}

Latest revision as of 20:27, 24 August 2026

UUID API

(OpenOS 1.6新加入)

uuid API是一个用于创建128位随机标识码的简易运行库。

  • uuid.next() string
返回128位随机标识码,以16进制数值的字符串形式表示,按照8,4,4,4,12的模式分组,中间用破折号分开。
例如:34eb7b28-14d3-4767-b326-dd1609ba92e。你可能会发现组件地址也使用了同样的模式。
print(require("uuid").next())

目录

< 100% 15% 15% >
API OpenOS buffer - colors - component - computer - event - filesystem - uuid - internet - keyboard - note - process - rc - robot - serialization - shell - sides - term - text - thread - transforms - unicode
::: Lua 库 coroutine - package - io - os