Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for DecodedLen (0.81 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/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)
  3. 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)
  4. 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)
  5. 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