...

Package bytesource

import "github.com/google/gofuzz/bytesource"
Overview
Index

Overview ▾

Package bytesource provides a rand.Source64 that is determined by a slice of bytes.

type ByteSource

ByteSource implements rand.Source64 determined by a slice of bytes. The random numbers are generated from each 8 bytes in the slice, until the last bytes are consumed, from which a fallback pseudo random source is created in case more random numbers are required. It also exposes a `bytes.Reader` API, which lets callers consume the bytes directly.

type ByteSource struct {
    *bytes.Reader
    // contains filtered or unexported fields
}

func New

func New(input []byte) *ByteSource

New returns a new ByteSource from a given slice of bytes.

func (*ByteSource) Int63

func (s *ByteSource) Int63() int64

func (*ByteSource) Seed

func (s *ByteSource) Seed(seed int64)

func (*ByteSource) Uint64

func (s *ByteSource) Uint64() uint64