Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for DecodedLen (0.27 sec)

  1. src/encoding/base32/base32.go

    	return &decoder{enc: enc, r: &newlineFilteringReader{r}}
    }
    
    // DecodedLen returns the maximum length in bytes of the decoded data
    // corresponding to n bytes of base32-encoded data.
    func (enc *Encoding) DecodedLen(n int) int {
    	return decodedLen(n, enc.padChar)
    }
    
    func decodedLen(n int, padChar rune) int {
    	if padChar == NoPadding {
    		return n/8*5 + n%8*5/8
    	}
    	return n / 8 * 5
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 14 16:25:54 UTC 2024
    - 15.9K bytes
    - Viewed (0)
  2. src/encoding/base64/base64.go

    	return &decoder{enc: enc, r: &newlineFilteringReader{r}}
    }
    
    // DecodedLen returns the maximum length in bytes of the decoded data
    // corresponding to n bytes of base64-encoded data.
    func (enc *Encoding) DecodedLen(n int) int {
    	return decodedLen(n, enc.padChar)
    }
    
    func decodedLen(n int, padChar rune) int {
    	if padChar == NoPadding {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:04:28 UTC 2023
    - 17.6K bytes
    - Viewed (0)
  3. src/encoding/base32/base32_test.go

    		tests = append(tests, test{rawStdEncoding, math.MaxInt, 5764607523034234879})
    	}
    	for _, tt := range tests {
    		if got := tt.enc.DecodedLen(tt.n); int64(got) != tt.want {
    			t.Errorf("DecodedLen(%d): got %d, want %d", tt.n, got, tt.want)
    		}
    	}
    }
    
    func TestWithoutPaddingClose(t *testing.T) {
    	encodings := []*Encoding{
    		StdEncoding,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 14 16:25:54 UTC 2024
    - 26K bytes
    - Viewed (0)
  4. src/encoding/base64/base64_test.go

    		tests = append(tests, test{RawStdEncoding, math.MaxInt, 6917529027641081855})
    	}
    	for _, tt := range tests {
    		if got := tt.enc.DecodedLen(tt.n); int64(got) != tt.want {
    			t.Errorf("DecodedLen(%d): got %d, want %d", tt.n, got, tt.want)
    		}
    	}
    }
    
    func TestBig(t *testing.T) {
    	n := 3*1000 + 1
    	raw := make([]byte, n)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Sep 03 18:57:29 UTC 2023
    - 15.9K bytes
    - Viewed (0)
  5. src/mime/encodedword.go

    	// maxContentLen is how much content can be encoded, ignoring the header and
    	// 2-byte footer.
    	maxContentLen = maxEncodedWordLen - len("=?UTF-8?q?") - len("?=")
    )
    
    var maxBase64Len = base64.StdEncoding.DecodedLen(maxContentLen)
    
    // bEncode encodes s using base64 encoding and writes it to buf.
    func (e WordEncoder) bEncode(buf *strings.Builder, charset, s string) {
    	w := base64.NewEncoder(base64.StdEncoding, buf)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 16:12:35 UTC 2024
    - 10K bytes
    - Viewed (0)
  6. internal/auth/credentials.go

    	}
    	if length <= 0 {
    		length = secretKeyMaxLen
    	}
    	if length < secretKeyMinLen {
    		return "", errors.New("auth: secret key length is too short")
    	}
    
    	key := make([]byte, base64.RawStdEncoding.DecodedLen(length))
    	if _, err := io.ReadFull(random, key); err != nil {
    		return "", err
    	}
    
    	s := base64.RawStdEncoding.EncodeToString(key)
    	return strings.ReplaceAll(s, "/", "+"), nil
    }
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue May 28 17:14:16 UTC 2024
    - 12K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apimachinery/pkg/runtime/codec.go

    	return s.identifier
    }
    
    func (s base64Serializer) Decode(data []byte, defaults *schema.GroupVersionKind, into Object) (Object, *schema.GroupVersionKind, error) {
    	out := make([]byte, base64.StdEncoding.DecodedLen(len(data)))
    	n, err := base64.StdEncoding.Decode(out, data)
    	if err != nil {
    		return nil, nil, err
    	}
    	return s.Decoder.Decode(out[:n], defaults, into)
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 12 03:20:30 UTC 2023
    - 12.1K bytes
    - Viewed (0)
  8. pkg/volume/util/atomic_writer_test.go

    AAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAfQAAAAAAAAB9AAAAAAAAAAAA
    IAAAAAAAsDyZDwU=`
    
    	mysteryBinaryBytes := make([]byte, base64.StdEncoding.DecodedLen(len(encodedMysteryBinary)))
    	numBytes, err := base64.StdEncoding.Decode(mysteryBinaryBytes, []byte(encodedMysteryBinary))
    	if err != nil {
    		t.Fatalf("Unexpected error decoding binary payload: %v", err)
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 11 09:02:45 UTC 2024
    - 30.5K bytes
    - Viewed (0)
  9. src/encoding/json/decode.go

    			if v.Type().Elem().Kind() != reflect.Uint8 {
    				d.saveError(&UnmarshalTypeError{Value: "string", Type: v.Type(), Offset: int64(d.readIndex())})
    				break
    			}
    			b := make([]byte, base64.StdEncoding.DecodedLen(len(s)))
    			n, err := base64.StdEncoding.Decode(b, s)
    			if err != nil {
    				d.saveError(err)
    				break
    			}
    			v.SetBytes(b[:n])
    		case reflect.String:
    			t := string(s)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:18:55 UTC 2024
    - 35.3K bytes
    - Viewed (0)
Back to top