// GetUint32 gets given key as a uint32
890
func (e *Entity) GetUint32(name string) (uint32, bool) {
	if v := e.Get(name); v != nil {
		switch x := v.(type) {
		case uint32:
			return x, true
		case uint64:
			return uint32(x), true
		}
	}
	return 0, false
}
1169078
func (e *Entity) GetUint64(name string) (uint64, bool) {
	x, ok := e.Get(name).(uint64)
	return x, ok
}
488246
func (mw *memoryWrapper) getUint(addr int64) *big.Int {
	if mw.memory.Len() < int(addr)+32 {
		// TODO(karalabe): We can't js-throw from Go inside duktape inside Go. The Go
		// runtime goes belly up https://github.com/golang/go/issues/15639.
		log.Warn("Tracer accessed out of bound memory", "available", mw.memory.Len(), "offset", addr, "size", 32)
		return new(big.Int)
	}
	return new(big.Int).SetBytes(mw.memory.GetPtr(addr, 32))
}
947535
func Uint32(val string) (uint32, error) {
	i, err := strconv.ParseUint(val, 0, 32)
	if err != nil {
		return 0, err
	}
	return uint32(i), nil
}
140424
func (hdr *rpmHeader) GetUint32s(tag int) ([]uint32, error) {
	buf, n, err := hdr.getInts(tag)
	if err != nil {
		return nil, err
	}
	if out, ok := buf.([]uint32); ok {
		return out, nil
	}
	out := make([]uint32, n)
	switch bvals := buf.(type) {
	case []uint8:
		for i, v := range bvals {
			out[i] = uint32(v)
		}
	case []uint16:
		for i, v := range bvals {
			out[i] = uint32(v)
		}
	default:
		return nil, fmt.Errorf("tag %d is too big for int type", tag)
	}
	return out, nil
}
558257
func (enc *Encoder) AddUint32Key(key string, v uint32) {
	enc.Uint64Key(key, uint64(v))
}
864483
func (l *Locking) Uint32() (v uint32) {
	l.Lock()
	v = l.R.Uint32()
	l.Unlock()
	return
}
681085
func (ctx *Context) QueryUint32(key string, defaults ...uint32) uint32 {
	return (*Queries)(ctx.req).MustUint32(key, defaults...)
}
290047
func PutUint32(b []byte, v uint32) {
	if l := len(b); l != 4 {
		panic(fmt.Sprintf("PutUint32: unexpected byte slice length: %d", l))
	}

	*(*uint32)(unsafe.Pointer(&b[0])) = v
}
1034266
func readUint32(data []byte) uint32 {
	var ret uint32
	buf := bytes.NewBuffer(data)
	binary.Read(buf, binary.LittleEndian, &ret)
	return ret
}
1260380
func (ctx *Context) FormUint32(key string, defaults ...uint32) uint32 {
	return (*Forms)(ctx.req).MustUint32(key, defaults...)
}
508683
func (p *Params) MustUint32(key string, defaults ...uint32) uint32 {
	r, err := strconv.ParseUint(p.Get(key), 10, 32)
	if len(defaults) > 0 && err != nil {
		return defaults[0]
	}

	return uint32(r)
}
1034637
func (f *Queries) Uint32(key string) (uint32, error) {
	s, err := f.String(key)
	if err != nil {
		return 0, err
	}
	v, err := strconv.ParseUint(s, 10, 32)
	return uint32(v), err
}
904193
func HashUint32(f func() hash.Hash32) func(uint32) uint32 {
	return func(u uint32) uint32 {
		b := [4]byte{}
		binary.BigEndian.PutUint32(b[:], u)
		h := f()
		h.Write(b[:])
		return h.Sum32()
	}
}
106656
func getu32(v []byte) uint32 {
	return uint32(v[0]) + (uint32(v[1]) << 8) + (uint32(v[2]) << 16) + (uint32(v[3]) << 24)
}
686569
func (stream *Stream) WriteUint32(val uint32) {
	q1 := val / 1000
	if q1 == 0 {
		stream.buf = writeFirstBuf(stream.buf, digits[val])
		return
	}
	r1 := val - q1*1000
	q2 := q1 / 1000
	if q2 == 0 {
		stream.buf = writeFirstBuf(stream.buf, digits[q1])
		stream.buf = writeBuf(stream.buf, digits[r1])
		return
	}
	r2 := q1 - q2*1000
	q3 := q2 / 1000
	if q3 == 0 {
		stream.buf = writeFirstBuf(stream.buf, digits[q2])
	} else {
		r3 := q2 - q3*1000
		stream.buf = append(stream.buf, byte(q3+'0'))
		stream.buf = writeBuf(stream.buf, digits[r3])
	}
	stream.buf = writeBuf(stream.buf, digits[r2])
	stream.buf = writeBuf(stream.buf, digits[r1])
}
481958
func (r *Store) GetUint8(key string) (uint8, error) {
	v, ok := r.GetEntry(key)
	if !ok {
		return 0, errFindParse.Format("uint8", key)
	}
	return v.Uint8Default(0)
}