Skip to main content

HashAxis

Trait HashAxis 

Source
pub trait HashAxis: AxisExtension {
    const AXIS_ADDRESS: &'static str = "https://uor.foundation/axis/HashAxis";
    const MAX_OUTPUT_BYTES: usize = 64;

    // Required method
    fn hash(input: &[u8], out: &mut [u8]) -> Result<usize, ShapeViolation>;
}
Expand description

Wiki ADR-031 canonical hash-function family.

Single kernel hash(input: &[u8], out: &mut [u8]) emitting the digest of input into the first Self::MAX_OUTPUT_BYTES of out. Per ADR-030’s signature constraint every axis-kernel method takes (input: &[u8], out: &mut [u8]) -> Result<usize, ShapeViolation>; HashAxis exposes only one kernel because per-impl (Sha256Hasher / Sha512Hasher / Sha3_256Hasher / Keccak256Hasher / Blake3Hasher) the axis position in the model’s AxisTuple already commits to a single digest family.

Provided Associated Constants§

Source

const AXIS_ADDRESS: &'static str = "https://uor.foundation/axis/HashAxis"

Source

const MAX_OUTPUT_BYTES: usize = 64

Required Methods§

Source

fn hash(input: &[u8], out: &mut [u8]) -> Result<usize, ShapeViolation>

Compute the digest of input into out[..n], returning n.

§Errors

Returns ShapeViolation if out is too small to hold the digest.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl HashAxis for Blake3Hasher

Source§

const AXIS_ADDRESS: &'static str = "https://uor.foundation/axis/HashAxis/Blake3"

Source§

const MAX_OUTPUT_BYTES: usize = BLAKE3_BYTES

Source§

impl HashAxis for Keccak256Hasher

Source§

const AXIS_ADDRESS: &'static str = "https://uor.foundation/axis/HashAxis/Keccak256"

Source§

const MAX_OUTPUT_BYTES: usize = KECCAK256_BYTES

Source§

impl HashAxis for Sha3_256Hasher

Source§

const AXIS_ADDRESS: &'static str = "https://uor.foundation/axis/HashAxis/Sha3_256"

Source§

const MAX_OUTPUT_BYTES: usize = SHA3_256_BYTES

Source§

impl HashAxis for Sha256Hasher

Source§

const AXIS_ADDRESS: &'static str = "https://uor.foundation/axis/HashAxis/Sha256"

Source§

const MAX_OUTPUT_BYTES: usize = SHA256_BYTES

Source§

impl HashAxis for Sha512Hasher

Source§

const AXIS_ADDRESS: &'static str = "https://uor.foundation/axis/HashAxis/Sha512"

Source§

const MAX_OUTPUT_BYTES: usize = SHA512_BYTES