// Uint32 returns a pseudo-random 32-bit value as a uint32.
776220
func (lr *LockedRand) Uint32() (n uint32) {
	lr.lk.Lock()
	n = lr.r.Uint32()
	lr.lk.Unlock()
	return
}
484994
func uint32FromNetwork(u uint32) uint32 {
	b := *(*[4]byte)(unsafe.Pointer(&u))
	return binary.BigEndian.Uint32(b[:])
}
947535
func Uint32(val string) (uint32, error) {
	i, err := strconv.ParseUint(val, 0, 32)
	if err != nil {
		return 0, err
	}
	return uint32(i), nil
}
430009
func UInt32Value(val string) (*wrappers.UInt32Value, error) {
	parsedVal, err := Uint32(val)
	return &wrappers.UInt32Value{Value: parsedVal}, err
}
434639
func (d *Decoder) Uint7() (uint8, error) {
	b, err := d.ReadByte()
	if err != nil {
		return 0, err
	}
	return (b & 0x7f), nil
}
456807
func Uint64(v uint64) *uint64 {
	p := new(uint64)
	*p = v
	return p
}
759442
func UInt32ToBytes(v uint32) []byte {
	ret := make([]byte, 4)
	Uint32ToBytesTo(v, ret)
	return ret
}
21241
func bytesToUint32(s []byte) uint32 {
	n := uint32(0)
	p := uint32(1)
	for i := range s {
		n += uint32(s[len(s)-1-i]-'0') * p
		p *= 10
	}
	return n
}
477082
func (w *ByteWriter) WriteUint32(val uint32, offset int) (int, error) {
	return w.WriteVal(val, offset)
}
85466
func Uint64(v interface{}) (uint64, bool) {

	switch reflect.TypeOf(v).Kind() {
	case reflect.Uint:
		return uint64(v.(uint)), true
	case reflect.Uint8:
		return uint64(v.(uint8)), true
	case reflect.Uint16:
		return uint64(v.(uint16)), true
	case reflect.Uint32:
		return uint64(v.(uint32)), true
	case reflect.Uint64:
		return v.(uint64), true
	}

	return 0, false
}
741943
func uint64ToBytes(number uint64) []byte {
	buf := make([]byte, 8)
	binary.LittleEndian.PutUint64(buf, number)
	return buf
}
1321073
func (b byteReader) Uint32() uint32 {
	if r := b.remain(); r < 4 {
		// Very rare
		v := uint32(0)
		for i := 1; i <= r; i++ {
			v = (v << 8) | uint32(b.b[len(b.b)-i])
		}
		return v
	}
	b2 := b.b[b.off : b.off+4 : b.off+4]
	v3 := uint32(b2[3])
	v2 := uint32(b2[2])
	v1 := uint32(b2[1])
	v0 := uint32(b2[0])
	return v0 | (v1 << 8) | (v2 << 16) | (v3 << 24)
}
536734
func UInt() gopter.Gen {
	return UInt64Range(0, math.MaxUint32).
		Map(uint64ToUint).
		WithShrinker(UIntShrinker)
}
7749
func AddUint32(h, u uint32) uint32 {
	h = (h ^ ((u >> 24) & 0xFF)) * prime32
	h = (h ^ ((u >> 16) & 0xFF)) * prime32
	h = (h ^ ((u >> 8) & 0xFF)) * prime32
	h = (h ^ ((u >> 0) & 0xFF)) * prime32
	return h
}
1103151
func WriteUInt32(w io.Writer, v uint) error {
	a := byte(v >> 24)
	b := byte(v >> 16)
	c := byte(v >> 8)
	d := byte(v)
	_, err := w.Write([]byte{a, b, c, d})
	if err != nil {
		return err
	}
	return nil
}
1215384
func (val XMValue) UInt32() (v uint32) {
	encoding.ReadFrom(bytes.NewBuffer(val), &v)
	return
}
1050650
func (s *Session) Uint32(key string) uint32 {
	s.RLock()
	defer s.RUnlock()

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

	value, ok := v.(uint32)
	if !ok {
		return 0
	}
	return value
}