ant-core 0.10.0

Headless Rust library for the Autonomi network: data storage and retrieval with self-encryption and EVM payments, plus node lifecycle management.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
//! Content-address verification shared by every transport and cache.
pub(crate) fn verify(address: &[u8; 32], content: &[u8]) -> Result<(), String> {
    let actual = ant_protocol::compute_address(content);
    if &actual != address {
        return Err(format!(
            "BLAKE3 mismatch: expected {}, received {}",
            hex::encode(address),
            hex::encode(actual)
        ));
    }
    Ok(())
}