Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement rand::RngCore for AntithesisRng #17

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

andrewgazelka
Copy link
Contributor

Adds AntithesisRng struct implementing the rand crate's RngCore trait, allowing integration with the broader Rust random number generation ecosystem. The implementation uses the existing get_random() function and adds methods like next_u32(), next_u64(), and fill_bytes(). Includes comprehensive tests for the new functionality.

Key changes:

  • Add use rand::{Error, RngCore}
  • Create AntithesisRng struct with RngCore implementation
  • Add tests using rand::Rng and SliceRandom traits

Adds `AntithesisRng` struct implementing the `rand` crate's `RngCore` trait, allowing integration with the broader Rust random number generation ecosystem. The implementation uses the existing `get_random()` function and adds methods like `next_u32()`, `next_u64()`, and `fill_bytes()`. Includes comprehensive tests for the new functionality.

Key changes:
- Add `use rand::{Error, RngCore}`
- Create `AntithesisRng` struct with `RngCore` implementation
- Add tests using `rand::Rng` and `SliceRandom` traits
@wsx-antithesis
Copy link
Contributor

Hi @andrewgazelka, thanks for the contribution! These changes look good to me.
I'm going to cut a new release after merging this.

@wsx-antithesis wsx-antithesis merged commit fc8b4da into antithesishq:main Oct 31, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants