Skip to content

fix no-std support (replace getrandom)#19

Merged
tomtomwombat merged 1 commit intotomtomwombat:mainfrom
eliad-wiz:foldhash
Jan 22, 2026
Merged

fix no-std support (replace getrandom)#19
tomtomwombat merged 1 commit intotomtomwombat:mainfrom
eliad-wiz:foldhash

Conversation

@eliad-wiz
Copy link
Contributor

currently, even when "std" feature is not selected, various std features are still used by various crates.

rand - rand::rng() finally requires "std", so make the "rand" feature automatically select it.

siphasher - disable default features.

getrandom - has no-std support (when its default features are not enabled), but it might actually link against various libs that might not be available
(e.g. bcryptprimitives.dll - rust-random/getrandom#65)

replace it with foldhash and concat 2 random u64 hashes in order to generate 128-bit seed.

currently, even when "std" feature is not selected, various std features
are still used by various crates.

rand - rand::rng() finally requires "std", so make the "rand" feature automatically
select it.

siphasher - disable default features.

getrandom - has no-std support (when its default features are not
enabled), but it might actually link against various libs that
might not be available
(e.g. bcryptprimitives.dll - rust-random/getrandom#65)

replace it with foldhash and concat 2 random u64 hashes in order to
generate 128-bit seed.

Signed-off-by: Eliad Peller <eliad.peller@wiz.io>
@tomtomwombat
Copy link
Owner

Thanks for catching this. So my understanding is that foldhash is not cryptographically random (since it doesn't rely on hardware sources) but more portable? I'll make this trade-off. I also noticed that hashbrown uses foldhash so that's reassuring.

@tomtomwombat tomtomwombat merged commit 8a6dabe into tomtomwombat:main Jan 22, 2026
2 checks passed
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