mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-06 03:14:22 +08:00
update 2026-06-04 00:28:20
This commit is contained in:
1 parent
a3dfac28a4
commit
623cdab94c
36 files changed
+468
-228
No files matched your search
@@ -154,12 +154,14 @@ function base64Encode(text)
|
||||
end
|
||||
|
||||
function UrlEncode(szText)
|
||||
if type(szText) ~= "string" then return "" end
|
||||
return szText:gsub("([^%w%-_%.%~])", function(c)
|
||||
return string.format("%%%02X", string.byte(c))
|
||||
end)
|
||||
end
|
||||
|
||||
function UrlDecode(szText)
|
||||
if type(szText) ~= "string" then return "" end
|
||||
return szText and szText:gsub("%+", " "):gsub("%%(%x%x)", function(h)
|
||||
return string.char(tonumber(h, 16))
|
||||
end) or nil
|
||||
|
||||
Reference in new issue
Block a user