// Copyright 2023 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !purego

package maphash

import (
	
)

//go:linkname runtime_rand runtime.rand
func runtime_rand() uint64

//go:linkname runtime_memhash runtime.memhash
//go:noescape
func runtime_memhash( unsafe.Pointer, ,  uintptr) uintptr

func rthash( []byte,  uint64) uint64 {
	if len() == 0 {
		return 
	}
	 := len()
	// The runtime hasher only works on uintptr. For 64-bit
	// architectures, we use the hasher directly. Otherwise,
	// we use two parallel hashers on the lower and upper 32 bits.
	if unsafe.Sizeof(uintptr(0)) == 8 {
		return uint64(runtime_memhash(unsafe.Pointer(&[0]), uintptr(), uintptr()))
	}
	 := runtime_memhash(unsafe.Pointer(&[0]), uintptr(), uintptr())
	 := runtime_memhash(unsafe.Pointer(&[0]), uintptr(>>32), uintptr())
	return uint64()<<32 | uint64()
}

func rthashString( string,  uint64) uint64 {
	 := unsafe.Slice(unsafe.StringData(), len())
	return rthash(, )
}

func randUint64() uint64 {
	return runtime_rand()
}