MCPcopy
hub / github.com/zu1k/proxypool / Base64DecodeString

Function Base64DecodeString

pkg/tool/base64.go:7–28  ·  view source on GitHub ↗
(src string)

Source from the content-addressed store, hash-verified

5)
6
7func Base64DecodeString(src string) (dst string, err error) {
8 if src == "" {
9 return "", nil
10 }
11 var dstbytes []byte
12 dstbytes, err = base64.RawURLEncoding.DecodeString(src)
13
14 if err != nil {
15 dstbytes, err = base64.RawStdEncoding.DecodeString(src)
16 }
17 if err != nil {
18 dstbytes, err = base64.StdEncoding.DecodeString(src)
19 }
20 if err != nil {
21 dstbytes, err = base64.URLEncoding.DecodeString(src)
22 }
23 if err != nil {
24 return "", err
25 }
26 dst = string(dstbytes)
27 return
28}
29
30func Base64EncodeString(origin string, urlsafe bool) (result string) {
31 if urlsafe {

Callers 4

ParseSSRLinkFunction · 0.92
ParseVmessLinkFunction · 0.92
ParseSSLinkFunction · 0.92
GetMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected