Search Apps Documentation Source Content File Folder Download Copy Actions Download

byteslice.gno

0.29 Kb · 21 lines
 1package byteslice
 2
 3import "strconv"
 4
 5type ByteState struct {
 6	data []byte
 7}
 8
 9func (b *ByteState) set(i int, v byte) {
10	b.data[i] = v
11}
12
13var state = ByteState{data: []byte{0, 0, 0}}
14
15func SetFirst(v byte) {
16	state.set(0, v)
17}
18
19func Render(_ string) string {
20	return strconv.Itoa(int(state.data[0]))
21}