// ParseUint64Value is used to parse a user provided *uint64 argument.
160403
func (b *NullByteSizeInMb) ParseUint64Value(val *uint64) {
	if val == nil {
		b.IsSet = false
		b.Value = 0
		return
	}

	b.Value = *val
	b.IsSet = true
}
258962
func ConvertUint32(str string) (uint32, error) {
	i, err := strconv.ParseUint(str, 10, 32)
	if err != nil {
		return 0, err
	}
	return uint32(i), nil
}
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
}
762488
func (e *Encoder) EncodeUint64(n uint64) error {
	return e.write8(codes.Uint64, n)
}
1145323
func DecodeOrderPreservingVarUint64(bytes []byte) (uint64, int) {
	s, _ := proto.DecodeVarint(bytes)
	size := int(s)
	decodedBytes := make([]byte, 8)
	copy(decodedBytes[8-size:], bytes[1:size+1])
	numBytesConsumed := size + 1
	return binary.BigEndian.Uint64(decodedBytes), numBytesConsumed
}
489340
func NewUint64(val uint64, p *uint64) *Uint64 {
	*p = val
	return (*Uint64)(p)
}
526967
func parseHexUint(v []byte) (n uint64, err error) {
	for i, b := range v {
		switch {
		case '0' <= b && b <= '9':
			b = b - '0'
		case 'a' <= b && b <= 'f':
			b = b - 'a' + 10
		case 'A' <= b && b <= 'F':
			b = b - 'A' + 10
		default:
			return 0, errors.New("invalid byte in chunk length")
		}
		if i == 16 {
			return 0, errors.New("http chunk length too large")
		}
		n <<= 4
		n |= uint64(b)
	}
	return
}
1174590
func (p *parserMixin) Uint64() (target *uint64) {
	target = new(uint64)
	p.Uint64Var(target)
	return
}
1169078
func (e *Entity) GetUint64(name string) (uint64, bool) {
	x, ok := e.Get(name).(uint64)
	return x, ok
}
1013362
func ParseUint64(s string) (uint64, bool) {
	if s == "" {
		return 0, true
	}
	if len(s) >= 2 && (s[:2] == "0x" || s[:2] == "0X") {
		v, err := strconv.ParseUint(s[2:], 16, 64)
		return v, err == nil
	}
	v, err := strconv.ParseUint(s, 10, 64)
	return v, err == nil
}
706920
func (b *BoltStore) GetUint64(key []byte) (uint64, error) {
	val, err := b.Get(key)
	if err != nil {
		return 0, err
	}
	return bytesToUint64(val), nil
}
682835
func randomUint64(r io.Reader) (uint64, error) {
	rv, err := binarySerializer.Uint64(r, bigEndian)
	if err != nil {
		return 0, err
	}
	return rv, nil
}
712918
func (tr Row) ForceUint64(nn int) (val uint64) {
	val, _ = tr.Uint64Err(nn)
	return
}
55276
func (context *BaseContext) SetUInt64(key string, value uint64) {
	context.userData[key] = value
}
778994
func NewUint64(v uint64) Value {
	return MakeTrusted(Uint64, strconv.AppendUint(nil, v, 10))
}
636973
func MaxUint64N(v ...uint64) uint64 {
	switch len(v) {
	case 0:
		return 0
	case 1:
		return v[0]
	case 2:
		return MaxUint64(v[0], v[1])
	default:
		l := len(v) / 2
		return MaxUint64N(MaxUint64N(v[:l]...), MaxUint64N(v[l:]...))
	}
}
549252
func ToUint(value interface{}) (uint64, error) {
	v := reflect.ValueOf(value)
	switch v.Kind() {
	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
		return v.Uint(), nil
	}
	return 0, fmt.Errorf("cannot convert %v to uint64", v.Kind())
}