Expand description
Implementation of Ethereum digest and hashing for Rust.
This crate provides a Digest type for representing an Ethereum 32-byte
digest as well as various Keccak-256 hashing utilities for computing them.
§Macros
There are a couple of exported macros for creating compile-time digest constants:
Under the hood, they are implemented with const fn and do not use
procedural macros.
§Features
- default
std: Additional integration with Rust standard library types. Notably, this includesstd::error::Errorimplementation on theParseDigestErrorand conversions fromVec<u8>. serde: Serialization traits for theserdecrate. Note that the implementation is very much geared towards JSON serialization withserde_json.sha3: Use the Rust Crypto Keccak-256 implementation (provided by thesha3crate) instead of the built-in one. Note that thekeccak!macro will always use the built-in Keccak-256 implementation for computing digests, assha3does not expose aconst fnAPI.
Modules§
- keccak
- A
const fnKeccak-256 implementation.
Macros§
- digest
- Macro to create Ethereum digest values from string literals that get parsed at compile time. A compiler error will be generated if an invalid digest is specified.
- keccak
- Macro to create Ethereum digest values for compile-time hashed input.
Structs§
Enums§
- Parse
Digest Error - Represents an error parsing a digest from a string.