// HashUint64 computes a hash of an int64. Hash is always non-zero.
557368
func HashUint64(key uint64) int64 {
	buf := make([]byte, 8)
	binary.BigEndian.PutUint64(buf, key)
	return HashKey(buf)
}
750846
func maxUint64(inputs ...uint64) uint64 {
	l := len(inputs)
	if l == 0 {
		return 0
	} else if l == 1 {
		return inputs[0]
	}

	max := inputs[0]
	for i := 1; i < l; i++ {
		cur := inputs[i]
		if cur > max {
			max = cur
		}
	}
	return max
}
682835
func randomUint64(r io.Reader) (uint64, error) {
	rv, err := binarySerializer.Uint64(r, bigEndian)
	if err != nil {
		return 0, err
	}
	return rv, nil
}
740879
func (enc *Encoder) encodeUint64(n uint64) ([]byte, error) {
	enc.buf = strconv.AppendUint(enc.buf, n, 10)
	return enc.buf, nil
}
50639
func (f *Queries) MustUint64(key string, defaults ...uint64) uint64 {
	if v, ok := f.Values()[key]; ok {
		i, err := strconv.ParseUint(v[0], 10, 64)
		if err == nil {
			return i
		}
	}
	if len(defaults) > 0 {
		return defaults[0]
	}
	return 0
}
739324
func sum64(h hash.Hash) (res uint64) {
	buf := make([]byte, 0, 8)
	s := h.Sum(buf)
	for _, b := range s {
		res <<= 8
		res |= uint64(b)
	}
	return
}
928748
func (b *SelectStmt) ReturnUint64() (uint64, error) {
	var v uint64
	err := b.LoadOne(&v)
	return v, err
}
731318
func maxUint64(ints ...uint64) uint64 {
	maxInt := ints[0]
	for i := 1; i < len(ints); i++ {
		if ints[i] > maxInt {
			maxInt = ints[i]
		}
	}

	return maxInt
}
217259
func New64(key []byte) (hash.Hash64, error) {
	if len(key) != Size {
		return nil, errKeySize
	}
	h := new(digest64)
	h.size = Size64
	copy(h.key[:], key)
	h.Reset()
	return h, nil
}
507026
func AddUint64(h uint64, u uint64) uint64 {
	h = h + u + constant
	h = (h<<shift | h>>(64-shift)) ^ u
	h = ((h<<shift | h>>(64-shift)) ^ constant) + u
	return h
}
197458
func (r *raftLog) GetUint64(k []byte) (uint64, error) {
	var v uint64
	vbytes, err := r.Get(k)
	if err == nil {
		v = binary.BigEndian.Uint64(vbytes)
	}
	return v, err
}
69057
func (r *Store) GetUint64(key string) (uint64, error) {
	v, ok := r.GetEntry(key)
	if !ok {
		return 0, errFindParse.Format("uint64", key)
	}
	return v.Uint64Default(0)
}
996641
func FromUint64(data [8]byte) uint64 {
	ui64 := binary.LittleEndian.Uint64(data[:])
	return ui64
}
1301288
func ToUint64(n uint64) [8]byte {
	s := make([]byte, 8)
	binary.LittleEndian.PutUint64(s, n)
	a := [8]byte{}
	copy(a[:], s[:8])
	return a
}
487121
func Hash(key uint64, numBuckets int) int32 {

	var b int64 = -1
	var j int64

	for j < int64(numBuckets) {
		b = j
		key = key*2862933555777941757 + 1
		j = int64(float64(b+1) * (float64(int64(1)<<31) / float64((key>>33)+1)))
	}

	return int32(b)
}
20300
func HashUint64(f func() hash.Hash64) func(uint64) uint64 {
	return func(u uint64) uint64 {
		b := [8]byte{}
		binary.BigEndian.PutUint64(b[:], u)
		h := f()
		h.Write(b[:])
		return h.Sum64()
	}
}
1249735
func randUint64(r *rand.Rand) uint64 {
	return uint64(r.Uint32())<<32 | uint64(r.Uint32())
}