Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 26 for sum (0.18 sec)

  1. cmd/encryption-v1_test.go

    			}
    			return a
    		}
    		lsum = func(s []int64) int64 {
    			sum := int64(0)
    			for _, i := range s {
    				if i < 0 {
    					return -1
    				}
    				sum += i
    			}
    			return sum
    		}
    		esum = func(oi ObjectInfo) int64 {
    			sum := int64(0)
    			for _, i := range oi.Parts {
    				sum += i.Size
    			}
    			return sum
    		}
    	)
    
    	s1 := []int64{5487701, 5487799, 3}
    	s2 := repeat(5487701, 5)
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sat Sep 24 04:17:08 GMT 2022
    - 19.9K bytes
    - Viewed (0)
  2. internal/hash/checksum.go

    		return nil
    	}
    	hasher := c.Type.Hasher()
    	_, err := hasher.Write(content)
    	if err != nil {
    		return err
    	}
    	sum := hasher.Sum(nil)
    	if !bytes.Equal(sum, c.Raw) {
    		return ChecksumMismatch{
    			Want: c.Encoded,
    			Got:  base64.StdEncoding.EncodeToString(sum),
    		}
    	}
    	return nil
    }
    
    // AsMap returns the
    func (c *Checksum) AsMap() map[string]string {
    	if c == nil || !c.Valid() {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 11.9K bytes
    - Viewed (0)
  3. internal/hash/reader.go

    				return 0, SizeTooLarge{Want: r.expectedMax, Got: r.bytesRead}
    			}
    		}
    
    		if r.sha256 != nil {
    			if sum := r.sha256.Sum(nil); !bytes.Equal(r.contentSHA256, sum) {
    				return n, SHA256Mismatch{
    					ExpectedSHA256:   hex.EncodeToString(r.contentSHA256),
    					CalculatedSHA256: hex.EncodeToString(sum),
    				}
    			}
    		}
    		if r.contentHasher != nil {
    			if r.contentHash.Type.Trailing() {
    				var err error
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Sep 18 17:00:54 GMT 2023
    - 10.8K bytes
    - Viewed (0)
  4. cmd/metrics.go

    			nil, nil),
    		prometheus.GaugeValue,
    		float64(offlineDisks.Sum()),
    	)
    
    	// MinIO Total Disks per node
    	ch <- prometheus.MustNewConstMetric(
    		prometheus.NewDesc(
    			prometheus.BuildFQName(minioNamespace, "drives", "total"),
    			"Total number of drives for current MinIO server instance",
    			nil, nil),
    		prometheus.GaugeValue,
    		float64(totalDisks.Sum()),
    	)
    
    	for _, disk := range server.Disks {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue Apr 02 06:48:36 GMT 2024
    - 16.9K bytes
    - Viewed (0)
  5. internal/jwt/parser.go

    	if err != nil {
    		return err
    	}
    	borrow := signer.HashBorrower()
    	hasher := hmac.New(borrow.Borrow, key)
    	hasher.Write(token[:i])
    	if !hmac.Equal((*bufp)[:n], hasher.Sum(nil)) {
    		borrow.ReturnAll()
    		return jwtgo.ErrSignatureInvalid
    	}
    	borrow.ReturnAll()
    
    	if claims.AccessKey == "" && claims.Subject == "" {
    		return jwtgo.NewValidationError("accessKey/sub missing",
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue May 09 07:53:08 GMT 2023
    - 13.9K bytes
    - Viewed (0)
  6. internal/config/identity/openid/openid.go

    			// ID, so we can get a short roleARN that stays the same on
    			// restart.
    			var resourceID string
    			{
    				h := sha1.New()
    				h.Write([]byte(p.ClientID))
    				bs := h.Sum(nil)
    				resourceID = base64.RawURLEncoding.EncodeToString(bs)
    			}
    			p.roleArn, err = arn.NewIAMRoleARN(resourceID, serverRegion)
    			if err != nil {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Nov 16 04:42:31 GMT 2023
    - 16.5K bytes
    - Viewed (0)
  7. cmd/metrics-resource.go

    		metric.Cumulative = val
    	} else {
    		metric.Current = val
    	}
    
    	if metric.Current > metric.Max {
    		metric.Max = val
    	}
    
    	metric.Sum += metric.Current
    	metric.Count++
    
    	metric.Avg = metric.Sum / float64(metric.Count)
    	subsysMetrics[key] = metric
    
    	resourceMetricsMap[subSys] = subsysMetrics
    }
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue Apr 23 23:56:12 GMT 2024
    - 17.4K bytes
    - Viewed (0)
  8. cmd/erasure-object_test.go

    		}
    
    		h := md5.New()
    		h.Write(testCase.content)
    		expectedHash := h.Sum(nil)
    
    		h.Reset()
    		_, err = io.Copy(h, gr)
    		if err != nil {
    			t.Fatalf("Test %d: Failed to calculate md5sum of the object: %v", i+1, err)
    		}
    		gr.Close()
    		foundHash := h.Sum(nil)
    
    		if !bytes.Equal(foundHash, expectedHash) {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue Jan 30 20:43:25 GMT 2024
    - 36.8K bytes
    - Viewed (0)
  9. cmd/erasure-metadata.go

    const erasureAlgorithm = "rs-vandermonde"
    
    // GetChecksumInfo - get checksum of a part.
    func (e ErasureInfo) GetChecksumInfo(partNumber int) (ckSum ChecksumInfo) {
    	for _, sum := range e.Checksums {
    		if sum.PartNumber == partNumber {
    			// Return the checksum
    			return sum
    		}
    	}
    	return ChecksumInfo{Algorithm: DefaultBitrotAlgorithm}
    }
    
    // ShardFileSize - returns final erasure size from original size.
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 19.2K bytes
    - Viewed (1)
  10. docs/debugging/xl-meta/main.go

    			hh, _ := highwayhash.New([]byte(magicHighwayHash256Key))
    			hh.Write(data)
    			got := hh.Sum(nil)
    			if bytes.Equal(want, got) {
    				s += ", \"bitrot_valid\": true"
    			} else {
    				s += ", \"bitrot_valid\": false"
    			}
    			s += "}"
    		}
    		res = append(res, []byte(s)...)
    	}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed Apr 24 17:56:22 GMT 2024
    - 20.2K bytes
    - Viewed (1)
Back to top