mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-10-30 08:05:13 +08:00
update 2026-08-09 12:59:02
This commit is contained in:
1 parent
43908ece96
commit
ce12490610
17 files changed
+85
-81
No files matched your search
@@ -669,15 +669,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