- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for DecodedLen (0.14 sec)
-
src/encoding/hex/hex.go
func (e InvalidByteError) Error() string { return fmt.Sprintf("encoding/hex: invalid byte: %#U", rune(e)) } // DecodedLen returns the length of a decoding of x source bytes. // Specifically, it returns x / 2. func DecodedLen(x int) int { return x / 2 } // Decode decodes src into [DecodedLen](len(src)) bytes, // returning the actual number of bytes written to dst. // // Decode expects that src contains only hexadecimal
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 08 19:30:23 UTC 2024 - 9.5K bytes - Viewed (0) -
src/encoding/hex/hex_test.go
// Encode always uses lowercase. decTests := append(encDecTests, encDecTest{"F8F9FAFBFCFDFEFF", []byte{0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff}}) for i, test := range decTests { dst := make([]byte, DecodedLen(len(test.enc))) n, err := Decode(dst, []byte(test.enc)) if err != nil { t.Errorf("#%d: bad return value: got:%d want:%d", i, n, len(dst)) } else if !bytes.Equal(dst, test.dec) {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 08 19:30:23 UTC 2024 - 7.9K bytes - Viewed (0) -
src/encoding/pem/pem.go
// The line must end with only whitespace. if s, _ := getLine(restOfEndLine); len(s) != 0 { continue } base64Data := removeSpacesAndTabs(rest[:endIndex]) p.Bytes = make([]byte, base64.StdEncoding.DecodedLen(len(base64Data))) n, err := base64.StdEncoding.Decode(p.Bytes, base64Data) if err != nil { continue } p.Bytes = p.Bytes[:n] // the -1 is because we might have only matched pemEnd without the
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 7.6K bytes - Viewed (0)