Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 20 for Sum32 (0.04 sec)

  1. src/compress/zlib/writer.go

    	if !z.wroteHeader {
    		z.err = z.writeHeader()
    	}
    	if z.err != nil {
    		return z.err
    	}
    	z.err = z.compressor.Close()
    	if z.err != nil {
    		return z.err
    	}
    	checksum := z.digest.Sum32()
    	// ZLIB (RFC 1950) is big-endian, unlike GZIP (RFC 1952).
    	binary.BigEndian.PutUint32(z.scratch[:], checksum)
    	_, z.err = z.w.Write(z.scratch[0:4])
    	return z.err
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 27 18:51:27 UTC 2023
    - 5.2K bytes
    - Viewed (0)
  2. pkg/kubelet/container/helpers.go

    func HashContainer(container *v1.Container) uint64 {
    	hash := fnv.New32a()
    	containerJSON, _ := json.Marshal(pickFieldsToHash(container))
    	hashutil.DeepHashObject(hash, containerJSON)
    	return uint64(hash.Sum32())
    }
    
    // pickFieldsToHash pick fields that will affect the running status of the container for hash,
    // currently this field range only contains `image` and `name`.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 04 06:25:43 UTC 2024
    - 14.3K bytes
    - Viewed (0)
  3. pilot/pkg/serviceregistry/serviceentry/controller.go

    	// so that we can deterministically allocate an IP.
    	// We use "Double Hashning" for collision detection.
    	// The hash algorithm is
    	// - h1(k) = Sum32 hash of the service key (namespace + "/" + hostname)
    	// - Check if we have an empty slot for h1(x) % MAXIPS. Use it if available.
    	// - If there is a collision, apply second hash i.e. h2(x) = PRIME - (Key % PRIME)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 29 15:31:09 UTC 2024
    - 36.8K bytes
    - Viewed (0)
  4. pkg/controller/history/controller_history.go

    	}
    	if revision.Data.Object != nil {
    		hashutil.DeepHashObject(hf, revision.Data.Object)
    	}
    	if probe != nil {
    		hf.Write([]byte(strconv.FormatInt(int64(*probe), 10)))
    	}
    	return rand.SafeEncodeString(fmt.Sprint(hf.Sum32()))
    }
    
    // SortControllerRevisions sorts revisions by their Revision.
    func SortControllerRevisions(revisions []*apps.ControllerRevision) {
    	sort.Stable(byRevision(revisions))
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Nov 05 13:33:52 UTC 2021
    - 18.2K bytes
    - Viewed (0)
  5. pkg/controller/tainteviction/taint_eviction.go

    type podUpdateItem struct {
    	podName      string
    	podNamespace string
    	nodeName     string
    }
    
    func hash(val string, max int) int {
    	hasher := fnv.New32a()
    	io.WriteString(hasher, val)
    	return int(hasher.Sum32() % uint32(max))
    }
    
    // GetPodsByNodeNameFunc returns the list of pods assigned to the specified node.
    type GetPodsByNodeNameFunc func(nodeName string) ([]*v1.Pod, error)
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 04 18:33:12 UTC 2024
    - 19.9K bytes
    - Viewed (0)
  6. src/image/png/writer.go

    	e.header[4] = name[0]
    	e.header[5] = name[1]
    	e.header[6] = name[2]
    	e.header[7] = name[3]
    	crc := crc32.NewIEEE()
    	crc.Write(e.header[4:8])
    	crc.Write(b)
    	binary.BigEndian.PutUint32(e.footer[:4], crc.Sum32())
    
    	_, e.err = e.w.Write(e.header[:8])
    	if e.err != nil {
    		return
    	}
    	_, e.err = e.w.Write(b)
    	if e.err != nil {
    		return
    	}
    	_, e.err = e.w.Write(e.footer[:4])
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 11 17:08:05 UTC 2024
    - 15.4K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/walk/compare.go

    	// We also include the string representation of the node to distinguish autogenerated expression since
    	// those get the same `src.XPos`
    	io.WriteString(hash, fmt.Sprintf("%v", n))
    
    	return ir.NewInt(base.Pos, int64(hash.Sum32()))
    }
    
    // The result of walkCompare MUST be assigned back to n, e.g.
    //
    //	n.Left = walkCompare(n.Left, init)
    func walkCompare(n *ir.BinaryExpr, init *ir.Nodes) ir.Node {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 24 21:55:14 UTC 2023
    - 16.2K bytes
    - Viewed (0)
  8. src/image/png/reader.go

    	}
    	return d.verifyChecksum()
    }
    
    func (d *decoder) verifyChecksum() error {
    	if _, err := io.ReadFull(d.r, d.tmp[:4]); err != nil {
    		return err
    	}
    	if binary.BigEndian.Uint32(d.tmp[:4]) != d.crc.Sum32() {
    		return FormatError("invalid checksum")
    	}
    	return nil
    }
    
    func (d *decoder) checkHeader() error {
    	_, err := io.ReadFull(d.r, d.tmp[:len(pngHeader)])
    	if err != nil {
    		return err
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:45 UTC 2023
    - 26K bytes
    - Viewed (0)
  9. pkg/controller/controller_utils.go

    		binary.LittleEndian.PutUint32(collisionCountBytes, uint32(*collisionCount))
    		podTemplateSpecHasher.Write(collisionCountBytes)
    	}
    
    	return rand.SafeEncodeString(fmt.Sprint(podTemplateSpecHasher.Sum32()))
    }
    
    func AddOrUpdateLabelsOnNode(kubeClient clientset.Interface, nodeName string, labelsToUpdate map[string]string) error {
    	firstTry := true
    	return clientretry.RetryOnConflict(UpdateLabelBackoff, func() error {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jan 12 15:34:44 UTC 2024
    - 47.6K bytes
    - Viewed (0)
  10. src/cmd/internal/testdir/testdir_test.go

    				}
    			})
    		}
    	}
    }
    
    func shardMatch(name string) bool {
    	if *shards <= 1 {
    		return true
    	}
    	h := fnv.New32()
    	io.WriteString(h, name)
    	return int(h.Sum32()%uint32(*shards)) == *shard
    }
    
    func goFiles(t *testing.T, dir string) []string {
    	f, err := os.Open(filepath.Join(testenv.GOROOT(t), "test", dir))
    	if err != nil {
    		t.Fatal(err)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 21 20:08:06 UTC 2024
    - 57.5K bytes
    - Viewed (0)
Back to top