macro_rules! b256 {
    () => { ... };
    ($($s:literal)+) => { ... };
}
Expand description

Converts a sequence of string literals containing hex-encoded data into a new B256 at compile time.

If the input is empty, a zero-initialized array is returned.

Note that the strings cannot be prefixed with 0x.

See hex! for more information.

§Examples

use alloy_primitives::{b256, B256};

const ZERO: B256 = b256!();
assert_eq!(ZERO, B256::ZERO);

let byte_array: B256 = b256!("0123abcd…");