Open ogxd opened 9 months ago
I got this working, generating the seed using the latter method here. I wanted to avoid drawing in more dependencies, and this actually reduces the number of dependencies, as rand
depends on all of these.
Interesting, so if I understand correctly, with your changes, the Hasher
remains even in no std
builds, but with the following subtleties:
std
feature, it creates a seed using a ChaCha12
rng, that is itself seeded using getrandom
(from OS)std
getrandom
will use rdrand
The author of ahash has done something similar, but making a separate crate for the build time random. Maybe we can reuse it to avoid the complexity introduced in build.rs
Nice! I have just cherry-picked your changes. Next step is to have this covered by tests/CI and add a few lines about it in the readme. I can do it when I have some time this week.
Hello! I'm sorry I haven't provided any update here. The no_std
is still very relevant. Since there might be some changes regarding the Hasher
construction and the dependencies, I've cherry-picked the first commit of this PR, even if the no_std
removes the Hasher
. This can be done as a second step once we have figured out what's best for the Hasher
seeds generation.
It would be possible to get the
hasher
module working ifrand
was swapped out forrand_chacha
inGxBuildHasher
and if it was given a constant seed inno_std
environments.const-random
could be used, or the seed could be generated in the build script.