Provides a BLAKE3-based ContentHash type with hashing, hex/base64 conversion, and serde support for use in audit chains and integrity checks.
// Source: https://github.com/astrid-runtime/astrid | License: Apache-2.0 | Copyright 2025 Joshua J. Bouw and Unicity Labs
// Provided via justclaw.it.com; keep this notice with the code.
//! Content hashing using BLAKE3.
//!
//! Provides fast, cryptographic content hashing for audit chains,
//! content verification, and integrity checking.
use serde::{Deserialize, Serialize};
use std::fmt;
/// A BLAKE3 content hash (32 bytes).
///
/// Used for:
/// - Audit chain linking (each entry hashes the previous)
/// - Content deduplication and verification
/// - Binary hash verification before execution
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
pub struct ContentHash([u8; 32]);
impl ContentHash {
/// Hash arbitrary data.
#[must_use]
pub fn hash(data: &[u8]) -> Self {
Self(*
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key