Cargo Features

ahash = { version = "0.8.6", default-features = false, features = ["std", "runtime-rng", "compile-time-rng", "no-rng", "atomic-polyfill", "serde"] }
default = runtime-rng, std

These default features are set whenever ahash is added without default-features = false somewhere in the dependency tree.

std default

Enabling this will enable AHashMap and AHashSet.

Affects ahash::HashMapExt, ahash::HashSetExt

runtime-rng default = getrandom

Runtime random key generation using getrandom.

compile-time-rng = const-random

This is an alternative to runtime key generation which does compile time key generation if runtime-rng is not available.
(If runtime-rng is enabled this does nothing.)
If this is on (and runtime-rng is off) it implies the produced binary will not be identical.
If this is disabled and runtime-rng is unavailable constant keys are used.


Do not use any random number generator (either at compile time or runtime)
If either runtime-rng or compile-time-rng are enabled this does nothing.


in case this is being used on an architecture lacking core::sync::atomic::AtomicUsize and friends

Enables atomic-polyfill, atomic-polyfill of once_cell

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features.

const-random compile-time-rng?
serde implicit feature

With default (std)

getrandom runtime-rng