// MustUint64 returns request form as uint64 with default
482507
func (f *Forms) MustUint64(key string, defaults ...uint64) uint64 {
	v, err := strconv.ParseUint((*http.Request)(f).FormValue(key), 10, 64)
	if len(defaults) > 0 && err != nil {
		return defaults[0]
	}
	return v
}
636514
func (d *defaulter) AsUint64(v Valuer, dv uint64) uint64 {
	value, err := v.Value()
	if err != nil {
		d.logValuerError(err)
		return dv
	}
	uivalue, err := strconv.ParseUint(value, 10, 64)
	if err != nil {
		d.logFormatError("uint64", err)
		return dv
	}
	return uint64(uivalue)
}
762488
func (e *Encoder) EncodeUint64(n uint64) error {
	return e.write8(codes.Uint64, n)
}
462031
func (f *Forms) MustInt64(key string, defaults ...int64) int64 {
	v, err := strconv.ParseInt((*http.Request)(f).FormValue(key), 10, 64)
	if len(defaults) > 0 && err != nil {
		return defaults[0]
	}
	return v
}
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
}
253384
func MustParseUint(s string, base, bitSize int) uint64 {
	// nolint: gosec
	i, _ := strconv.ParseUint(s, base, bitSize)
	return i
}
682835
func randomUint64(r io.Reader) (uint64, error) {
	rv, err := binarySerializer.Uint64(r, bigEndian)
	if err != nil {
		return 0, err
	}
	return rv, nil
}
943906
func (ctx *Context) CookieUint64(key string, defaults ...uint64) uint64 {
	return ctx.Cookies().MustUint64(key, defaults...)
}
782090
func (r *Store) GetUint64Default(key string, def uint64) uint64 {
	if v, err := r.GetUint64(key); err == nil {
		return v
	}

	return def
}
1121503
func (c *cookies) MustUint(key string, defaults ...uint) uint {
	ck, err := c.req.Cookie(key)
	if err != nil {
		if len(defaults) > 0 {
			return defaults[0]
		}
		return 0
	}
	v, err := strconv.ParseUint(ck.Value, 10, 64)
	if len(defaults) > 0 && err != nil {
		return defaults[0]
	}
	return uint(v)
}
1315396
func EncodeUint64(i uint64) string {
	enc := make([]byte, 2, 10)
	copy(enc, "0x")
	return string(strconv.AppendUint(enc, i, 16))
}
231126
func MinimumUint(path, in string, data, min uint64, exclusive bool) *errors.Validation {
	if (!exclusive && data < min) || (exclusive && data <= min) {
		return errors.ExceedsMinimumUint(path, in, min, exclusive)
	}
	return nil
}
528011
func (c ShortChannelID) ToUint64() uint64 {
	// TODO(roasbeef): explicit error on overflow?
	return ((uint64(c.BlockHeight) << 40) | (uint64(c.TxIndex) << 16) |
		(uint64(c.TxPosition)))
}
110002
func (ctx *Context) QueryUint64(key string, defaults ...uint64) uint64 {
	return (*Queries)(ctx.req).MustUint64(key, defaults...)
}
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
}
1143269
func (b *SelectStmt) ReturnUint64s() ([]uint64, error) {
	var v []uint64
	_, err := b.Load(&v)
	return v, err
}
811937
func (f *Queries) MustUint(key string, defaults ...uint) uint {
	if v, ok := f.Values()[key]; ok {
		i, err := strconv.ParseUint(v[0], 10, 64)
		if err == nil {
			return uint(i)
		}
	}
	if len(defaults) > 0 {
		return defaults[0]
	}
	return 0
}