Skip to content

Conversation

@dhardy
Copy link
Member

@dhardy dhardy commented Nov 30, 2025

This exposes the (unused part of the) results buffer in BlockRng, allowing external serialization.

I have code implementing serde for IsaacRng over this as a proof-of-concept, though it's not pretty.

Note that if this is provided, it might be nice to also support directly setting the index to allow consuming a &[u32] slice of results.

@dhardy
Copy link
Member Author

dhardy commented Dec 6, 2025

@newpavlov any comment? I will update this after #34 is merged.

I think returning &[W] is preferable to [W; N] as you used in #24.

I also considered making further changes to index / reset / generate_and_set methods (e.g. replacing generate_and_set with separate generate and skip methods), but this didn't work out so well with downstream usage.

The current design should be compatible with placing the index in results so long as we forbid calling generate_and_set(0) (with a few tweaks to block code), but separate generate() and skip(n) methods are not. I'll leave this to a new PR.

@dhardy dhardy mentioned this pull request Dec 8, 2025
1 task
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