1
0
mirror of https://github.com/bestnite/sub2clash.git synced 2025-12-16 02:50:16 +00:00

♻️ Refactor parsers

This commit is contained in:
2024-04-23 14:39:16 +08:00
parent 48dece2a51
commit ebc91d8aad
15 changed files with 549 additions and 371 deletions

View File

@@ -7,6 +7,11 @@ import (
func DecodeBase64(s string) (string, error) {
s = strings.TrimSpace(s)
// url safe
if strings.Contains(s, "-") || strings.Contains(s, "_") {
s = strings.Replace(s, "-", "+", -1)
s = strings.Replace(s, "_", "/", -1)
}
if len(s)%4 != 0 {
s += strings.Repeat("=", 4-len(s)%4)
}