[][src]Crate numext_fixed_hash

A series of fixed hash types.

Constructors

This crate provides a series of macros that used to construct fixed hashes in compile time.

The input is a hexadecimal string literal with 0x prefix. Completed strings or trimmed strings both are allowed.

And you can use any number of _ in the string literal to separate it for more readable.

Examples

use numext_fixed_hash::{h128, H128};

const H128_VAL: H128 = h128!("0x123456789abcdef");

fn main () -> ::std::io::Result<()> {
    let x1 = h128!("0x123456789abcdef");
    let x2 = h128!("0x00000000000000000123456789abcdef");
    let y = H128::from_trimmed_hex_str("123456789abcdef").unwrap();
    assert_eq!(x1, y);
    assert_eq!(x2, y);
    assert_eq!(H128_VAL, y);
    Ok(())
}

Modules

prelude

Macros

h128

A macro used to construct a fixed hash in compile time.

h160

A macro used to construct a fixed hash in compile time.

h224

A macro used to construct a fixed hash in compile time.

h256

A macro used to construct a fixed hash in compile time.

h384

A macro used to construct a fixed hash in compile time.

h512

A macro used to construct a fixed hash in compile time.

h520

A macro used to construct a fixed hash in compile time.

h1024

A macro used to construct a fixed hash in compile time.

h2048

A macro used to construct a fixed hash in compile time.

h4096

A macro used to construct a fixed hash in compile time.

Structs

H128

Fixed hash type.

H160

Fixed hash type.

H224

Fixed hash type.

H256

Fixed hash type.

H384

Fixed hash type.

H512

Fixed hash type.

H520

Fixed hash type.

H1024

Fixed hash type.

H2048

Fixed hash type.

H4096

Fixed hash type.