-
Notifications
You must be signed in to change notification settings - Fork 5
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
Feature Discussion: Generic Seeds #13
Comments
Thanks for the praise! Currently, seeding is implemented using One thing to keep in mind however is, that there are still a theoretically finite amount of possible configurations of the permutation table, even if the seed was more flexible. Specifically it would be the factorial of the permutation table size. This is set through a constant to 256, meaning a finite set of 256! possible permutations. In that sense, it might indeed make sense to allow for more flexibility when seeding. After all u64 does not nearly cover enough states to do a permutation table of that size justice. |
Upon further inspection, chacha is using 32 byte seeds. This is by no means perfectly generalizable, and without generic const expressions I don't think I can create a nice API for more genuinely mostly arbitrary seeds. However, I have whipped up something that at least exposes the full API of the underlying chacha RNG. That means, seeds can still be This is done by introducing a I'll wait a bit to see if there are some more suggestions or ideas here. If not, I'll go ahead and merge+publish this with the minor semver bump it entails as version 1.1.2 :) |
…-seeds generalize seeds (see issue #13), minor semver bump
Before coming across this great library, I was about to spin my own noise crate! Thanks for saving me the hassle - this seems fantastic!
However, I do have a weird feature request that only might make sense. I would love to be able to provide theoretically infinite seeds, such as vectors/arrays of values - or even a string slice, to the generator.
Do you know if this is viable from an implementation standpoint? You don't need to worry about implementing it - I don't think it's widely interesting. However, I'm definitely interested!
From what I can tell, rand_chacha happily implements
Seed
for any byte slice, so you can give it any kind of data to get random data back. That should allow it to work for sources that usecore::utils::ptable::PermutationTable
, at least ifseed
also allowed anything serializable to[u8]
.Once again, thanks for the great library! 🦀✨
The text was updated successfully, but these errors were encountered: