The core::hash::SipHash
can be accessed without std
or alloc
, but the recommended std::collections::hash_map::DefaultHasher
can't.
There's no need for std to maintain SipHash
in particular. Std needs some hash for hash map, but that hash should remain unspecified and be allowed to change. So, committing std to provide specifically SipHash just for the hashmap was a mistake, which was rectified by deprecating the functionality. It is likely that, at some point, std does switch to a different hash function, and SipHasher implementation in the stdlib is replaced with unoptimized simple implementation, to reduce the size of std.
Maybe std
needs to expose a SipHash
not for the purpose of seeding hash map, but for the purpose of providing basic cryptography primitives. That is, something like std::crypto::SipHash
. But there's no std::crypto
module today, and adding it would require much more thorough motivation that stably exposing something we already have by accident.