Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader will return a reader that will return an endless stream of pseudo-random data. The Reader supports seeking and arbitrary async reads from io.ReadAt.
func NewReader ¶
func NewReader(opts ...ReaderOption) (*Reader, error)
NewReader returns a new Reader.
type ReaderOption ¶
type ReaderOption func(options *readerOptions) error
ReaderOption provides an option to NewReader.
func WithFullReset ¶
func WithFullReset(b bool) ReaderOption
WithFullReset will fully re-seed the reader on Reset. If set the entire stream will be randomized. If not set, it would be possible to derive a 32 byte xor value that makes it possible to predict a stream from the previous output.
func WithRNG ¶
func WithRNG(rng io.Reader) ReaderOption
WithRNG allows to use a specific reader for entropy. Otherwise a math/rand prng with a seed based on current time will be added.
func WithSize ¶
func WithSize(size int64) ReaderOption
WithSize limits the reader to a specific size.