MCPcopy
hub / github.com/mzz2017/gg / Base64URLDecode

Function Base64URLDecode

common/util.go:41–52  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

39}
40
41func Base64URLDecode(s string) (string, error) {
42 s = strings.TrimSpace(s)
43 saver := s
44 if len(s)%4 > 0 {
45 s += strings.Repeat("=", 4-len(s)%4)
46 }
47 raw, err := base64.URLEncoding.DecodeString(s)
48 if err != nil {
49 return saver, err
50 }
51 return string(raw), nil
52}
53
54func ObjectToKV(v interface{}, tagName string) (kv []string) {
55 a := structs.New(v)

Callers 5

ParseSSURLFunction · 0.92
ParseVmessURLFunction · 0.92
ParseSSRURLFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected