func (r *ISAAC) Uint8() byte {
	return r.NextBytes(1)[0]
}
Uint8 Returns the next byte from the ISAAC CSPRNG receiver instance.
package isaac
import (
	"sync"
)
const MixMask = 0xFF << 2
const phi = 0x9E3779B9
type ISAAC struct {
	randrsl [256]uint32
	randcnt int
	state			   [256]uint32
	acc1, acc2, counter uint32
	index			   int
	remainder		   []byte
	sync.RWMutex
}
func (r *ISAAC) Seed(seed int64) {
	r.randrsl = padKeys(int(seed))
	r.randInit()
}
func (r *ISAAC) generateNextSet() {
	r.counter++
	r.acc2 += r.counter
	var shifts = [...]uint { 13, 6, 2, 16 }
	for i := uint32(0); i < 256; i += 1 {
		prevState := r.state[i]
		var mixed uint32
		if i&1 == 0 {
			mixed = r.acc1^r.acc1 << shifts[i&3]
		} else {
			mixed = r.acc1^r.acc1 >> shifts[i&3]
		}
		r.acc1 = mixed + r.state[(i+128)&0xFF]
		r.state[i] = r.acc1 + r.state[(prevState >> 2)&0xFF] + r.acc2
		r.acc2 = prevState + r.state[(r.state[i]>>10)&0xFF]
		r.randrsl[i] = r.acc2
	}
}
func (r *ISAAC) randInit() {
	var mess = [...]uint32 { phi, phi, phi, phi, phi, phi, phi, phi }
	mix := func() {
		var shifts = [...]uint { 11, 2, 8, 16, 10, 4, 8, 9 }
		for i := 0; i < 8; i++ {
			if i&1 == 0 {
				mess[i] ^= (mess[(i+1)&7] << shifts[i&7])
			} else {
				mess[i] ^= (mess[(i+1)&7] >> shifts[i&7])
			}
			mess[(i+3)&7] += mess[i]
			mess[(i+1)&7] += mess[(i+2)&7]
		}
	}
	fillMess := func(state [256]uint32) {
		for i := 0; i < 256; i += 8 {  
			for i1, v := range state[i : i+8] {
				mess[i1] += v
			}
			mix()
			for i1, v := range mess {
				r.state[i+i1] = v
			}
		}
	}
	for i := 0; i < 4; i++ {
		mix()
	}
	r.Lock()
	fillMess(r.randrsl)
	fillMess(r.state)
	r.generateNextSet()  
	r.randcnt = 256  
	r.Unlock()
}
func (r *ISAAC) Uint64() (number uint64) {
	return uint64(r.Uint32()) << 32 | uint64(r.Uint32())
}
func (r *ISAAC) Int63() (number int64) {
	return int64(r.Uint64())
}
func (r *ISAAC) Uint32() (number uint32) {
	r.Lock()
	defer r.Unlock()
	if r.randcnt <= 0 {
		r.generateNextSet()
		r.randcnt = 256
	}
	r.randcnt--
	return uint32(r.randrsl[r.randcnt])
}
func (r *ISAAC) Int31() int32 {
	return int32(r.Uint32())
}
func (r *ISAAC) Int() int {
	return int(r.Int31())
}
func (r *ISAAC) Intn(n int) int {
	if n <= 0 {
		panic("invalid argument to Intn")
	}
	if n <= 1<<31-1 {
		return int(r.Int31n(int32(n)))
	}
	return int(r.Int63n(int64(n)))
}
func (r *ISAAC) Int31n(n int32) int32 {
	v := r.Uint32()
	prod := uint64(v) * uint64(n)
	low := uint32(prod)
	if low < uint32(n) {
		thresh := uint32(-n) % uint32(n)
		for low < thresh {
			v = r.Uint32()
			prod = uint64(v) * uint64(n)
			low = uint32(prod)
		}
	}
	return int32(prod >> 32)
}
func (r *ISAAC) Int63n(n int64) int64 {
	if n <= 0 {
		return -1
	}
	if n&(n-1) == 0 {  
		return r.Int63() & (n - 1)
	}
	max := int64((1 << 63) - 1 - ((1<<63)%uint64(n)))
	v := r.Int63()
	for v > max {
		v = r.Int63()
	}
	return v % n
}
func (r *ISAAC) Uint8n(bound byte) (number byte) {
	for number = r.Uint8(); number < 0 || number >= bound; number = r.Uint8() {
	}
	return
}
func (r *ISAAC) Uint16() uint16 {
	buf := r.NextBytes(2)
	return uint16(buf[0])<<8 | uint16(buf[1])
}