Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for Sum32 (0.03 sec)

  1. src/hash/fnv/fnv.go

    	s[1] = offset128Lower
    	return &s
    }
    
    func (s *sum32) Reset()   { *s = offset32 }
    func (s *sum32a) Reset()  { *s = offset32 }
    func (s *sum64) Reset()   { *s = offset64 }
    func (s *sum64a) Reset()  { *s = offset64 }
    func (s *sum128) Reset()  { s[0] = offset128Higher; s[1] = offset128Lower }
    func (s *sum128a) Reset() { s[0] = offset128Higher; s[1] = offset128Lower }
    
    func (s *sum32) Sum32() uint32  { return uint32(*s) }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat May 18 22:36:41 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  2. src/hash/crc32/crc32_test.go

    				t.Errorf("could not unmarshal: %v", err)
    				continue
    			}
    
    			io.WriteString(h, g.in[len(g.in)/2:])
    			io.WriteString(h2, g.in[len(g.in)/2:])
    
    			if h.Sum32() != h2.Sum32() {
    				t.Errorf("IEEE(%s) = 0x%x != marshaled 0x%x", g.in, h.Sum32(), h2.Sum32())
    			}
    		}
    	})
    	t.Run("Castagnoli", func(t *testing.T) {
    		table := MakeTable(Castagnoli)
    		for _, g := range golden {
    			h := New(table)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 03 14:56:25 UTC 2024
    - 12.1K bytes
    - Viewed (0)
  3. internal/ringbuffer/ring_buffer_test.go

    		}
    		t.Fatalf("expect read %d bytes but got %d", wroteBytes, readBytes)
    	}
    	if readHash.Sum32() != wroteHash.Sum32() {
    		t.Fatalf("expect read hash 0x%08x but got 0x%08x", readHash.Sum32(), wroteHash.Sum32())
    	}
    }
    
    func TestRingBuffer_BlockingBig(t *testing.T) {
    	// Typical runtime is ~5-10s.
    	defer timeout(60 * time.Second)()
    	const debug = false
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Wed May 15 00:11:04 UTC 2024
    - 26.8K bytes
    - Viewed (0)
  4. src/hash/crc32/crc32.go

    	// initialization in this case.
    	d.crc = update(d.crc, d.tab, p, false)
    	return len(p), nil
    }
    
    func (d *digest) Sum32() uint32 { return d.crc }
    
    func (d *digest) Sum(in []byte) []byte {
    	s := d.Sum32()
    	return append(in, byte(s>>24), byte(s>>16), byte(s>>8), byte(s))
    }
    
    // Checksum returns the CRC-32 checksum of data
    // using the polynomial represented by the [Table].
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun May 12 05:36:29 UTC 2024
    - 7.5K bytes
    - Viewed (0)
  5. src/hash/adler32/adler32.go

    		s1 %= mod
    		s2 %= mod
    		p = q
    	}
    	return digest(s2<<16 | s1)
    }
    
    func (d *digest) Write(p []byte) (nn int, err error) {
    	*d = update(*d, p)
    	return len(p), nil
    }
    
    func (d *digest) Sum32() uint32 { return uint32(*d) }
    
    func (d *digest) Sum(in []byte) []byte {
    	s := uint32(*d)
    	return append(in, byte(s>>24), byte(s>>16), byte(s>>8), byte(s))
    }
    
    // Checksum returns the Adler-32 checksum of data.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun May 12 05:36:29 UTC 2024
    - 3K bytes
    - Viewed (0)
  6. 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)
  7. 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)
  8. 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)
Back to top