MCPcopy
hub / github.com/rclone/rclone / NewNameEncoding

Function NewNameEncoding

backend/crypt/cipher.go:156–169  ·  view source on GitHub ↗

NewNameEncoding creates a NameEncoding from a string

(s string)

Source from the content-addressed store, hash-verified

154
155// NewNameEncoding creates a NameEncoding from a string
156func NewNameEncoding(s string) (enc fileNameEncoding, err error) {
157 s = strings.ToLower(s)
158 switch s {
159 case "base32":
160 enc = caseInsensitiveBase32Encoding{}
161 case "base64":
162 enc = base64.RawURLEncoding
163 case "base32768":
164 enc = base32768.SafeEncoding
165 default:
166 err = fmt.Errorf("unknown file name encoding mode %q", s)
167 }
168 return enc, err
169}
170
171// Cipher defines an encoding and decoding cipher for the crypt backend
172type Cipher struct {

Callers 15

newCipherForConfigFunction · 0.85
testEncodeFileNameFunction · 0.85
TestDecodeFileNameBase32Function · 0.85
TestDecodeFileNameBase64Function · 0.85
testEncryptSegmentFunction · 0.85
TestDecryptSegmentBase32Function · 0.85
TestDecryptSegmentBase64Function · 0.85

Calls 1

ErrorfMethod · 0.45

Tested by 15

testEncodeFileNameFunction · 0.68
TestDecodeFileNameBase32Function · 0.68
TestDecodeFileNameBase64Function · 0.68
testEncryptSegmentFunction · 0.68
TestDecryptSegmentBase32Function · 0.68
TestDecryptSegmentBase64Function · 0.68
TestEncDecMatchesFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…