MCPcopy Create free account
hub / github.com/apache/fory / decodeRepAllToLowerSpecial

Method decodeRepAllToLowerSpecial

go/fory/meta/meta_string_decoder.go:104–122  ·  view source on GitHub ↗
(data []byte, algorithm Encoding)

Source from the content-addressed store, hash-verified

102}
103
104func (d *Decoder) decodeRepAllToLowerSpecial(data []byte, algorithm Encoding) ([]byte, error) {
105 // Decode the data to the lowercase letters, then convert
106 str, err := d.decodeGeneric(data, algorithm)
107 if err != nil {
108 return nil, err
109 }
110 chars := make([]byte, len(str))
111 j := 0
112 for i := 0; i < len(str); i++ {
113 if str[i] == '|' {
114 chars[j] = str[i+1] - 'a' + 'A'
115 i++
116 } else {
117 chars[j] = str[i]
118 }
119 j++
120 }
121 return chars[0:j], nil
122}
123
124/** Decoding char for two encoding algorithms */
125func (d *Decoder) decodeChar(val byte, encoding Encoding) (byte, error) {

Callers 1

DecodeMethod · 0.95

Calls 1

decodeGenericMethod · 0.95

Tested by

no test coverage detected