// Uint7 reads a byte and converts the first 7 bits into an uint8
434639
func (d *Decoder) Uint7() (uint8, error) {
	b, err := d.ReadByte()
	if err != nil {
		return 0, err
	}
	return (b & 0x7f), nil
}
581708
func UInt64() (i uint64) {
	randomBits(r)
	buf := bytes.NewBuffer(r)
	binary.Read(buf, binary.LittleEndian, &i)
	return i
}
1032870
func (s *Session) Uint8(key string) uint8 {
	s.RLock()
	defer s.RUnlock()

	v, ok := s.data[key]
	if !ok {
		return 0
	}

	value, ok := v.(uint8)
	if !ok {
		return 0
	}
	return value
}
677782
func (v Value) Uint64() (uint64, error) {
	i, err := strconv.ParseUint(v.String(), 10, 64)
	if err != nil {
		return 0, v.invalidTypeError(err, "uint64")
	}
	return i, nil
}
1007444
func ReverseBytes32(x uint32) uint32 {
	const m = 1<<32 - 1
	x = x>>8&(m3&m) | x&(m3&m)<<8
	return x>>16 | x<<16
}
1371564
func (val XMValue) UInt8() (v uint8) {
	encoding.ReadFrom(bytes.NewBuffer(val), &v)
	return
}
536734
func UInt() gopter.Gen {
	return UInt64Range(0, math.MaxUint32).
		Map(uint64ToUint).
		WithShrinker(UIntShrinker)
}
937228
func reverseUint32(v uint32) (x uint32) {
	x |= uint32(reverseLUT[byte(v>>0)]) << 24
	x |= uint32(reverseLUT[byte(v>>8)]) << 16
	x |= uint32(reverseLUT[byte(v>>16)]) << 8
	x |= uint32(reverseLUT[byte(v>>24)]) << 0
	return x
}
47007
func (b byteReader) Uint32() uint32 {
	v3 := uint32(b.b[b.off+3])
	v2 := uint32(b.b[b.off+2])
	v1 := uint32(b.b[b.off+1])
	v0 := uint32(b.b[b.off])
	return (v3 << 24) | (v2 << 16) | (v1 << 8) | v0
}
938810
func (e *Event) Uint8(key string, i uint8) *Event {
	if e == nil {
		return e
	}
	e.buf = enc.AppendUint8(enc.AppendKey(e.buf, key), i)
	return e
}
527180
func uint32ToBytes(number uint32) []byte {
	buf := make([]byte, 4)
	binary.LittleEndian.PutUint32(buf, number)
	return buf
}
1114193
func UInt32() (i uint32) {
	randomBits(r)
	buf := bytes.NewBuffer(r)
	binary.Read(buf, binary.LittleEndian, &i)
	return i
}
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
}
745928
func uint32Bytes(i uint32) []byte {
	bytes := make([]byte, 4)
	binary.BigEndian.PutUint32(bytes, i)
	return bytes
}
347796
func ReadVarUint64(r io.Reader) (uint64, error) {
	var result uint64
	var shift uint64
	buf := make([]byte, 1)
	for {
		if _, err := r.Read(buf); err != nil {
			return 0, err
		}
		v := uint64(buf[0])
		result |= (v & 0x7F) << shift
		if v&0x80 == 0 {
			return result, nil
		}
		shift += 7
	}

}
556508
func (ae *AttributeEncoder) Uint8(typ uint16, v uint8) {
	if ae.err != nil {
		return
	}

	ae.attrs = append(ae.attrs, Attribute{
		Type: typ,
		Data: []byte{v},
	})
}
924787
func swap32(i uint32) uint32 {
	if Native == binary.BigEndian {
		return i
	}
	return (i&0xff000000)>>24 | (i&0xff0000)>>8 | (i&0xff00)<<8 | (i&0xff)<<24
}