Crates.io | weird-data |
lib.rs | weird-data |
version | 0.2.0 |
source | src |
created_at | 2023-12-30 16:01:38.296633 |
updated_at | 2024-01-05 11:36:42.245167 |
description | Generate random data in such a way as to make rare edge-cases very likely. |
homepage | |
repository | https://github.com/PanieriLorenzo/weird-data |
max_upload_size | |
id | 1084286 |
size | 35,264 |
Note: this crate is still in development and might change in the future.
Disclaimer: the random number generators used in this crate are NOT CRYPTOGRAPHICALLY SECURE. Only use these generators for generating testing inputs, do not rely on them for cryptographic purposes in production code! For instance, you may test a cryptographic tool with these generators, but you may not deploy code that relies on these generators for security in production.
Generate random data in such a way as to make rare edge-cases very likely.
For instance, if generating a random f32
by uniformly sampling 32 bits of data, certain values will rarely appear, such as NAN
and INFINITY
. When doing randomized testing, like fuzzing, it isn't very useful to repeatedly generate well-behaved data. It is much more useful if we can artificially increase the likelihood of these special values, so that we test with them more often.
Additionally, some random number crates will never generate certain problematic bit-patterns, such as NAN
.
This crate is based on the fastrand crate.
f32
and f64
values
NAN
numbersEPSILON
and -0.0
MAX
, MIN
String
.