hashavatar keeps the published crate dependency graph focused on rendering:
-
imagefor raster buffers and WebP encoding -
palettefor color conversion -
randfor deterministic seeded variation -
optional
serdefor string serialization/deserialization of public style enums when theserdefeature is enabled -
transitive
sha2for default SHA-512 identity hashing throughsanitization-crypto-interop -
subtlefor constant-time identity digest comparison -
sanitizationfor clearing derived identity digests, temporary hash preimage buffers, renderer seed copies, and temporary image/encoder buffers -
sanitization-crypto-interopfor SHA-512 hashing and hasher-state cleanup through the upstreamsha2zeroization hooks, and for BLAKE3 hasher/XOF cleanup when theblake3feature is enabled -
optional
blake3for BLAKE3 identity hashing when theblake3feature is enabled -
optional
xxhash-rustfor XXH3-128 identity distribution when thexxh3feature is enabled -
optional
image/pngencoder support when thepngfeature is enabled -
optional
image/jpegencoder support when thejpegfeature is enabled -
optional
image/gifencoder support when thegiffeature is enabled Dev-only test dependencies: -
roxmltreefor parser-backed SVG well-formedness tests and fuzz harness validation -
serde_jsonfor feature-gated serde round-trip tests -
kaniis a reserved Cargo feature for verifier harnesses. It does not add a runtime dependency; Kani itself is an external release-evidence tool.
SHA-512 remains the default identity mode, and WebP remains the default raster
encoder. sanitization-crypto-interop is a direct dependency so SHA-512 uses
the cleanup boundary provided by the sanitization sister crate instead of
direct zeroize imports in hashavatar; sha2 is otherwise direct only for
test fingerprint helpers. blake3, xxhash-rust, serde, image/png,
image/jpeg, and image/gif are explicit opt-in features so default users
keep the smaller conservative dependency graph and only compile extra support
they use. The blake3 and xxh3 features are mutually exclusive because
identity hashing is a crate-wide mode, not a runtime selection.
The crate must not depend on web frameworks, async runtimes, network clients, or service infrastructure. Those concerns belong in hashavatar-api.
Dependency changes should be reviewed for:
- whether the latest stable crate version is being used
- security advisory history
- default features
- transitive dependency growth
- license compatibility with
MIT OR Apache-2.0 - whether the dependency is needed by the reusable crate or only by an application
- Prefer the latest compatible stable release of each direct dependency.
- Before adding or changing a dependency, check current upstream information from crates.io, docs.rs, the crate repository, and RustSec advisories. Use web search when needed to confirm the crate is still maintained and that the chosen API reflects current guidance.
- Do not pin an older crate version unless there is a documented reason, such as a security concern, MSRV constraint, regression, license issue, or unacceptable transitive dependency growth.
- Re-check dependency freshness before stable releases with
cargo update,cargo audit,cargo deny check, andcargo outdatedwhen available. - New optional dependencies must be justified in README/docs and covered by tests for their enabled feature path.
blake3is admitted for callers that want BLAKE3 identity derivation and dependency-provided SIMD support where the crate and platform provide it.xxhash-rustis admitted only for non-cryptographic XXH3-128 identity distribution. Do not present XXH3-128 as an adversarial collision-resistant identity hash, and do not recommend it for user-controlled identifiers unless the application first maps those identifiers through its own cryptographic boundary.- Optional dependency features must be tested in valid feature combinations
before release. Do not use
cargo test --all-featuresbecause theblake3andxxh3identity-hash modes are intentionally mutually exclusive.
scripts/validate-dependencies.sh enforces the current dependency allowlist.
hashavatar is intentionally a single image-generation crate. Raster buffers,
SVG rendering, encoders, deterministic identity hashing, and public avatar
options are kept together so the published API stays focused on producing
avatars.
Lower-level planning helpers should remain internal unless a future image-generation use case justifies exposing them. A separate non-rendering core crate is not part of the current roadmap.