mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-29 16:15:13 +08:00
🎄 Sync 2026-09-26 02:25:56
This commit is contained in:
1 parent
99196a85d3
commit
4136a9b488
73 files changed
+2401
-4124
No files matched your search
@@ -1920,6 +1920,25 @@ function fetch_cert_sha256(host, port, sni, timeout, http3)
|
||||
return fp:upper()
|
||||
end
|
||||
|
||||
function sha256_xray_sb(str)
|
||||
local decoded = base64Decode(str)
|
||||
if decoded ~= str and #decoded == 32 then return str end
|
||||
local hex = str:gsub(":", "")
|
||||
if #hex ~= 64 or not hex:match("^[A-Fa-f0-9]+$") then return str end
|
||||
local binary = hex:gsub("%x%x", function(byte)
|
||||
return string.char(tonumber(byte, 16))
|
||||
end)
|
||||
return base64Encode(binary)
|
||||
end
|
||||
|
||||
function sha256_sb_xray(str)
|
||||
local binary = base64Decode(str)
|
||||
if binary == str or #binary ~= 32 then return str end
|
||||
return (binary:gsub(".", function(byte)
|
||||
return string.format("%02X", string.byte(byte))
|
||||
end))
|
||||
end
|
||||
|
||||
function vps_domain_exclude(domain)
|
||||
domain = trim(domain)
|
||||
if domain == "" then return true end
|
||||
|
||||
Reference in new issue
Block a user