randstream

Crates.iorandstream
lib.rsrandstream
version0.4.1
created_at2025-09-27 16:40:11.15284+00
updated_at2025-12-23 10:28:37.526403+00
descriptionReproducible Random Stream Generator and Validator
homepagehttps://github.com/xcp-ng/randstream/
repositoryhttps://github.com/xcp-ng/randstream.git
max_upload_size
id1857461
size57,010
Gaƫtan Lehmann (glehmann)

documentation

https://github.com/xcp-ng/randstream/

README

randstream: Reproducible Random Stream Generator and Validator

randstream is a high-performance command-line utility for creating and validating reproducible, pseudo-random data streams. It is designed for use cases such as verifying storage integrity, benchmarking I/O performance, or generating large, arbitrary datasets for testing.

The utility uses a seed to ensure that the generated data is reproducible. In order to be validatable without regeneration on the data, the stream is processed in chunks (32KB by default), and each chunk includes a checksum of 4 bytes at its end for integrity verification. It also uses parallel processing to ensure maximum throughput on modern hardware, while keeping the output identical independently of the number of parallel tasks.

Installation

Download the archive for your platform from the releases page.

Or install the binary with cargo-binstall:

cargo binstall ranstream

Or install from source:

cargo install randstream

Usage

randstream has two main commands: generate and validate.

Generating a Random Stream (generate)

Use the generate command to create a reproducible stream of pseudo-random data.

Validating a Random Stream (validate)

Use the validate command to verify that an existing stream has not been corrupted or altered. The validation process will re-generate the data internally using the same seed and compare it byte-for-byte with the input stream.

Examples

Fill a whole block device:

randstream generate /dev/xvdb

Generate a 100 GB file using a specific seed and 2 parallel tasks:

randstream generate --size 10G --seed 12345678 --jobs 2 output.bin

Validate a previously generated stream:

randstream generate output.bin
Commit count: 0

cargo fmt