Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for fitsInBase256 (0.18 sec)

  1. src/archive/tar/strconv.go

    	if len(s) > len(b) && b[len(b)-1] == '/' {
    		n := len(strings.TrimRight(s[:len(b)-1], "/"))
    		b[n] = 0 // Replace trailing slash with NUL terminator
    	}
    }
    
    // fitsInBase256 reports whether x can be encoded into n bytes using base-256
    // encoding. Unlike octal encoding, base-256 encoding does not require that the
    // string ends with a NUL character. Thus, all n bytes are available for output.
    //
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Tue Aug 01 14:28:42 GMT 2023
    - 9K bytes
    - Viewed (0)
  2. src/archive/tar/strconv_test.go

    		{0, 9, true},
    		{math.MinInt64, 9, true},
    		{math.MaxInt64, 12, true},
    		{0, 12, true},
    		{math.MinInt64, 12, true},
    	}
    
    	for _, v := range vectors {
    		ok := fitsInBase256(v.width, v.in)
    		if ok != v.ok {
    			t.Errorf("fitsInBase256(%d, %d): got %v, want %v", v.in, v.width, ok, v.ok)
    		}
    	}
    }
    
    func TestParseNumeric(t *testing.T) {
    	vectors := []struct {
    		in   string
    		want int64
    		ok   bool
    	}{
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Tue Feb 09 05:28:50 GMT 2021
    - 14K bytes
    - Viewed (0)
  3. src/archive/tar/common.go

    			} else {
    				paxHdrs[paxKey] = s
    			}
    		}
    		if v, ok := h.PAXRecords[paxKey]; ok && v == s {
    			paxHdrs[paxKey] = v
    		}
    	}
    	verifyNumeric := func(n int64, size int, name, paxKey string) {
    		if !fitsInBase256(size, n) {
    			whyNoGNU = fmt.Sprintf("GNU cannot encode %s=%d", name, n)
    			format.mustNotBe(FormatGNU)
    		}
    		if !fitsInOctal(size, n) {
    			whyNoUSTAR = fmt.Sprintf("USTAR cannot encode %s=%d", name, n)
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri Mar 15 16:01:50 GMT 2024
    - 24.7K bytes
    - Viewed (2)
Back to top