MCPcopy Create free account
hub / github.com/cel-expr/cel-go / base64DecodeURLString

Function base64DecodeURLString

ext/encoders.go:392–401  ·  view source on GitHub ↗
(str string)

Source from the content-addressed store, hash-verified

390}
391
392func base64DecodeURLString(str string) ([]byte, error) {
393 b, err := base64.URLEncoding.DecodeString(str)
394 if err == nil {
395 return b, nil
396 }
397 if _, tryAltEncoding := err.(base64.CorruptInputError); tryAltEncoding {
398 return base64.RawURLEncoding.DecodeString(str)
399 }
400 return nil, err
401}
402
403func base64EncodeBytes(bytes []byte) (string, error) {
404 return base64.StdEncoding.EncodeToString(bytes), nil

Callers 1

CompileOptionsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected