agentic-receipts 0.1.0

Signed, tamper-evident execution receipts for AI agents, tool calls, GPU workloads, and distributed jobs.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use sha2::{Digest, Sha256};

pub fn sha256_hex(data: &[u8]) -> String {
    let hash = Sha256::digest(data);
    format!("sha256:{}", hex::encode(hash))
}

pub fn receipt_hash<T: serde::Serialize>(receipt: &T) -> Result<String, serde_json::Error> {
    let bytes = serde_json::to_vec(receipt)?;
    Ok(sha256_hex(&bytes))
}