mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-11-01 10:53:56 +08:00
update 2026-09-26 07:00:56
This commit is contained in:
1 parent
8971d1aa5c
commit
7b88b273d0
66 files changed
+20572
-10
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