Skip to content

Commit b1bcdcf

Browse files
committed
Add license and readme
Signed-off-by: Gaëtan Lehmann <[email protected]>
1 parent 1076d47 commit b1bcdcf

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Gaëtan Lehmann
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# randstream: Reproducible Stream Generator and Validator
2+
3+
**`randstream`** is a high-performance command-line utility for creating and
4+
validating reproducible, pseudo-random data streams. It is designed for use
5+
cases such as verifying storage integrity, benchmarking I/O performance, or
6+
generating large, arbitrary datasets for testing.
7+
8+
The utility uses a **seed** to ensure that the generated data is reproducible.
9+
In order to be validatable without regeneration on the data, the stream includes
10+
a **checksum** of 4 bytes at the end of each chunk.
11+
It also uses **parallel processing** to ensure maximum throughput on modern
12+
hardware, while keeping the output identical independently of the number of
13+
parallel tasks.
14+
15+
## Installation
16+
17+
```bash
18+
cargo install randstream
19+
````
20+
21+
## Usage
22+
23+
`randstream` has two main commands: **`generate`** and **`validate`**.
24+
25+
### Generating a Random Stream (`generate`)
26+
27+
Use the generate command to create a reproducible stream of pseudo-random data.
28+
29+
## Validating a Random Stream (`validate`)
30+
31+
Use the `validate` command to verify that an existing stream has not been
32+
corrupted or altered. The validation process will **re-generate** the data
33+
internally using the same seed and compare it byte-for-byte with the input
34+
stream.
35+
36+
### Examples
37+
38+
**Fill a whole block device:**
39+
40+
```bash
41+
randstream generate /dev/xvdb
42+
```
43+
44+
**Generate a 100 GB file using a specific seed and 2 parallel tasks:**
45+
46+
```bash
47+
randstream generate --size 10G --seed 1a234e5678 --jobs 2 output.bin
48+
```
49+
50+
**Validate a previously generated stream:**
51+
52+
```bash
53+
randstream generate output.bin
54+
```

0 commit comments

Comments
 (0)