Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for stringHash (0.12 sec)

  1. src/runtime/alg.go

    // Testing adapters for hash quality tests (see hash_test.go)
    //
    // stringHash should be an internal detail,
    // but widely used packages access it using linkname.
    // Notable members of the hall of shame include:
    //   - github.com/k14s/starlark-go
    //
    // Do not remove or change the type signature.
    // See go.dev/issue/67401.
    //
    //go:linkname stringHash
    func stringHash(s string, 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)
  2. src/runtime/hash_test.go

    }
    func (s *HashSet) add(h uintptr) {
    	s.list = append(s.list, h)
    }
    func (s *HashSet) addS(x string) {
    	s.add(StringHash(x, 0))
    }
    func (s *HashSet) addB(x []byte) {
    	s.add(BytesHash(x, 0))
    }
    func (s *HashSet) addS_seed(x string, seed uintptr) {
    	s.add(StringHash(x, seed))
    }
    func (s *HashSet) check(t *testing.T) {
    	list := s.list
    	slices.Sort(list)
    
    	collisions := 0
    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/hash/maphash/smhasher_test.go

    					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
    	h.SetSeed(fixedSeed)
    	h.WriteString(s)
    	return h.Sum64()
    }
    
    const hashSize = 64
    
    func randBytes(r *rand.Rand, b []byte) {
    	r.Read(b) // can't fail
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 16:41:38 UTC 2024
    - 11K bytes
    - Viewed (0)
  4. src/runtime/export_test.go

    			}
    			done <- true
    		}()
    		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)
  5. android/guava-tests/test/com/google/common/util/concurrent/JSR166TestCase.java

        @Override
        public Object call() {
          return Boolean.TRUE;
        }
      }
    
      public static final String TEST_STRING = "a test string";
    
      public static class StringTask implements Callable<String> {
        @Override
        public String call() {
          return TEST_STRING;
        }
      }
    
      public Callable<String> latchAwaitingStringTask(final CountDownLatch latch) {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Jun 10 19:21:11 UTC 2024
    - 37.7K bytes
    - Viewed (0)
Back to top