Skip to main content

mint_topic_id

Function mint_topic_id 

Source
pub fn mint_topic_id(file_hash: &str, sender_hex: &str) -> String
Expand description

Mint a fresh realtime-channel topic id for an outbound .xdc attachment.

32 bytes of SHA-256 over a domain separator + file hash + sender + send-time nanos, encoded base32 (RFC 4648, no padding) — the same codec the miniapp realtime layer’s decode_topic_id expects, so the tag value round-trips into an iroh TopicId. The nanos input makes re-sends of the same file distinct sessions.