Skip to content

math/rand: add io.Reader interface to type Rand #8330

@wathiede

Description

@wathiede
This is a feature request I would be willing to implement if it is deemed appropriate.

I often find myself wanting to generate large pseudo-randomly filled files for testing
and benchmarks.  The io.Reader interface in crypto/rand is nice, but it is
non-deterministic by design.  Having an io.Reader interface on math/rand.Rand, paired
with a consistent seed, would allow consistent random number generation from run-to-run
of tests and benchmarks.

Would this be an appropriate addition to the standard library?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions