mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-02 06:13:56 +08:00
update 2026-08-09 16:35:03
This commit is contained in:
1 parent
ce12490610
commit
b50cf2822f
28 files changed
+137
-227
No files matched your search
@@ -642,15 +642,12 @@ function get_full_node_remarks(n)
|
||||
return remarks
|
||||
end
|
||||
|
||||
function gen_uuid(format)
|
||||
function gen_uuid()
|
||||
local uuid = sys.exec("echo -n $(cat /proc/sys/kernel/random/uuid)")
|
||||
if format == nil then
|
||||
uuid = string.gsub(uuid, "-", "")
|
||||
end
|
||||
return uuid
|
||||
end
|
||||
|
||||
function gen_short_uuid(length)
|
||||
function gen_random_char(length)
|
||||
if not length then length = 8 end
|
||||
return sys.exec("echo -n $(head /dev/urandom | tr -dc A-Za-z0-9 | head -c %s)" % length)
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user