Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 26 for Sum32 (0.13 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. pkg/util/hash/hash_test.go

    		hasher2 := adler32.New()
    		hasher3 := adler32.New()
    		// Act
    		DeepHashObject(hasher1, myUni1)
    		hash1 := hasher1.Sum32()
    		DeepHashObject(hasher1, myUni1)
    		hash1a := hasher1.Sum32()
    		DeepHashObject(hasher2, myUni2)
    		hash2 := hasher2.Sum32()
    		DeepHashObject(hasher3, myUni3)
    		hash3 := hasher3.Sum32()
    
    		// Assert
    		if hash1 != hash1a {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Mar 27 01:24:22 UTC 2023
    - 4.4K bytes
    - Viewed (0)
  3. 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)
  4. src/hash/fnv/fnv_test.go

    	if a := h.Sum(nil); !bytes.Equal(sum, a) {
    		t.Fatalf("Sum()=0x%x, but with partial writes, Sum()=0x%x", sum, a)
    	}
    
    	switch h.Size() {
    	case 4:
    		sum32 := h.(hash.Hash32).Sum32()
    		if sum32 != binary.BigEndian.Uint32(sum) {
    			t.Fatalf("Sum()=0x%x, but Sum32()=0x%x", sum, sum32)
    		}
    	case 8:
    		sum64 := h.(hash.Hash64).Sum64()
    		if sum64 != binary.BigEndian.Uint64(sum) {
    			t.Fatalf("Sum()=0x%x, but Sum64()=0x%x", sum, sum64)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 01 21:04:12 UTC 2017
    - 7.3K bytes
    - Viewed (0)
  5. src/hash/adler32/adler32_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("checksum(%q) = 0x%x != marshaled (0x%x)", g.in, h.Sum32(), h2.Sum32())
    		}
    	}
    }
    
    func BenchmarkAdler32KB(b *testing.B) {
    	b.SetBytes(1024)
    	data := make([]byte, 1024)
    	for i := range data {
    		data[i] = byte(i)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 01 21:04:12 UTC 2017
    - 5.5K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/authentication/token/cache/cache_striped.go

    }
    func (c *stripedCache) remove(key string) {
    	c.caches[c.hashFunc(key)%c.stripeCount].remove(key)
    }
    
    func fnvHashFunc(key string) uint32 {
    	f := fnv.New32()
    	f.Write([]byte(key))
    	return f.Sum32()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Oct 22 17:16:59 UTC 2018
    - 1.6K bytes
    - Viewed (0)
  7. pkg/kubelet/checkpointmanager/checksum/checksum.go

    	return Checksum(getChecksum(data))
    }
    
    // Get returns calculated checksum of checkpoint data
    func getChecksum(data interface{}) uint64 {
    	hash := fnv.New32a()
    	hashutil.DeepHashObject(hash, data)
    	return uint64(hash.Sum32())
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 25 01:56:43 UTC 2019
    - 1.3K bytes
    - Viewed (0)
  8. 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)
  9. src/hash/hash.go

    	// are a multiple of the block size.
    	BlockSize() int
    }
    
    // Hash32 is the common interface implemented by all 32-bit hash functions.
    type Hash32 interface {
    	Hash
    	Sum32() uint32
    }
    
    // Hash64 is the common interface implemented by all 64-bit hash functions.
    type Hash64 interface {
    	Hash
    	Sum64() uint64
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 19:15:34 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  10. pkg/controller/deployment/util/hash_test.go

    	}
    }
    
    func getPodTemplateSpecOldHash(template v1.PodTemplateSpec) uint32 {
    	podTemplateSpecHasher := adler32.New()
    	hashutil.DeepHashObject(podTemplateSpecHasher, template)
    	return podTemplateSpecHasher.Sum32()
    }
    
    func BenchmarkFnv(b *testing.B) {
    	spec := v1.PodTemplateSpec{}
    	json.Unmarshal([]byte(podSpec), &spec)
    
    	for i := 0; i < b.N; i++ {
    		controller.ComputeHash(&spec, nil)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Jan 28 19:00:40 UTC 2019
    - 4K bytes
    - Viewed (0)
Back to top