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

Restrict the seed type to a few more array sizes #80

Merged
merged 1 commit into from
Dec 31, 2017

Conversation

pitdicker
Copy link

I am not sure this is a good idea, but this are seed sizes I encountered with the RNG's implemented in small-rngs.

@dhardy
Copy link
Owner

dhardy commented Dec 29, 2017

Down to 32-bit? You said yourself you thought 128-bits should be a minimum, didn't you?

My view is that we should provide a "good seeding" function, not the default one, if it's possible to seed a small PRNG from a larger seed. We could also provide a function like X::seed_official(n: u32) if applicable.

I guess though we can accommodate all those sizes if need be.

@pitdicker
Copy link
Author

I did 😄, as a minimum for 'worry free initialisation'. I would not recommend seeding with something less than 96 bits.

I definitely agree that if we can provide a better seeding function, we should do so.

But I have two cases in mind where seeding with 32 bits is best: Jenkins small fast RNG because only for those seeds is experimentally proven that there are no very short cycles. And I have seen a 32-bit Xorshift used in data structures as a super tiny source of just a little randomness.

It is of course possible to seed with a larger array, and only use a part of it. But this seems more 'honest' to me.

I didn't like adding the extra sizes, but can't really see harm in it either.

@pitdicker
Copy link
Author

Shall I put some 'not recommended' comments after the small sizes?

@dhardy dhardy merged commit 45ace88 into dhardy:master Dec 31, 2017
@pitdicker pitdicker deleted the seed_sizes branch January 21, 2018 15:31
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