mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 23:45:13 +08:00
🍉 Sync 2026-05-26 21:02:29
This commit is contained in:
1 parent
9d8ff233fa
commit
997c127ca1
9 files changed
+142
-7
No files matched your search
@@ -132,12 +132,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