Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for bytesHash (0.16 sec)

  1. src/hash/maphash/smhasher_test.go

    				var c [KEYMAX + OFFMAX + 2*PAD]byte
    				randBytes(r, b[:])
    				randBytes(r, c[:])
    				copy(c[PAD+i:PAD+i+n], b[PAD:PAD+n])
    				if bytesHash(b[PAD:PAD+n]) != bytesHash(c[PAD+i:PAD+i+n]) {
    					t.Errorf("hash depends on bytes outside key")
    				}
    			}
    		}
    	}
    }
    
    func bytesHash(b []byte) uint64 {
    	var h Hash
    	h.SetSeed(fixedSeed)
    	h.Write(b)
    	return h.Sum64()
    }
    func stringHash(s string) uint64 {
    	var h Hash
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 16:41:38 UTC 2024
    - 11K bytes
    - Viewed (0)
  2. src/runtime/hash_test.go

    				var b [KEYMAX + OFFMAX + 2*PAD]byte
    				var c [KEYMAX + OFFMAX + 2*PAD]byte
    				randBytes(r, b[:])
    				randBytes(r, c[:])
    				copy(c[PAD+i:PAD+i+n], b[PAD:PAD+n])
    				if BytesHash(b[PAD:PAD+n], 0) != BytesHash(c[PAD+i:PAD+i+n], 0) {
    					t.Errorf("hash depends on bytes outside key")
    				}
    			}
    		}
    	}
    }
    
    type HashSet struct {
    	list []uintptr // list of hashes added
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 06 17:50:18 UTC 2024
    - 18.4K bytes
    - Viewed (0)
  3. src/runtime/alg.go

    // See go.dev/issue/67401.
    //
    //go:linkname stringHash
    func stringHash(s string, seed uintptr) uintptr {
    	return strhash(noescape(unsafe.Pointer(&s)), seed)
    }
    
    func bytesHash(b []byte, seed uintptr) uintptr {
    	s := (*slice)(unsafe.Pointer(&b))
    	return memhash(s.array, seed, uintptr(s.len))
    }
    
    func int32Hash(i uint32, seed uintptr) uintptr {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 13.6K bytes
    - Viewed (0)
  4. src/runtime/export_test.go

    		}()
    		for atomic.Xadd(ready, 1); atomic.Load(ready) != 2; {
    		}
    		runqput(p, &gs[1], next1)
    		runqget(p)
    		<-done
    		runqget(p)
    	}
    }
    
    var (
    	StringHash = stringHash
    	BytesHash  = bytesHash
    	Int32Hash  = int32Hash
    	Int64Hash  = int64Hash
    	MemHash    = memhash
    	MemHash32  = memhash32
    	MemHash64  = memhash64
    	EfaceHash  = efaceHash
    	IfaceHash  = ifaceHash
    )
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:50:53 UTC 2024
    - 46.1K bytes
    - Viewed (0)
Back to top