Skip to content

Conversation

@dhardy
Copy link
Member

@dhardy dhardy commented Nov 24, 2025

  • Added a CHANGELOG.md entry

Summary

Subset of #24 for non-block generators (essentially I copied and cut all the block stuff).

Motivation

I found #24 difficult to review: too large and I'm not 100% convinced we should drop the block code.

Details

Documentation is tweaked slightly.

@dhardy dhardy requested a review from newpavlov November 24, 2025 13:55
Comment on lines -123 to -135
/// Implement `next_u32` via `fill_bytes`, little-endian order.
pub fn next_u32_via_fill<R: RngCore + ?Sized>(rng: &mut R) -> u32 {
let mut buf = [0; 4];
rng.fill_bytes(&mut buf);
u32::from_le_bytes(buf)
}

/// Implement `next_u64` via `fill_bytes`, little-endian order.
pub fn next_u64_via_fill<R: RngCore + ?Sized>(rng: &mut R) -> u64 {
let mut buf = [0; 8];
rng.fill_bytes(&mut buf);
u64::from_le_bytes(buf)
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These have no replacement, but are rarely (if ever: getrandom doesn't use them) needed, so removal is fine.

@dhardy
Copy link
Member Author

dhardy commented Dec 1, 2025

I like the new helpers slightly more than what we did have. The question is whether we want to introduce trait Word on top of keeping a variant of the block code?

@dhardy dhardy closed this Dec 6, 2025
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