Function ruma::signatures::reference_hash

source ·
pub fn reference_hash(
    value: &BTreeMap<String, CanonicalJsonValue>,
    version: &RoomVersionId,
) -> Result<String, Error>
Available on crate feature signatures only.
Expand description

Creates a reference hash for an event.

Returns the hash as a base64-encoded string, using the standard character set, without padding.

The reference hash of an event covers the essential fields of an event, including content hashes. It is used to generate event identifiers and is described in the Matrix server-server specification.

§Parameters

object: A JSON object to generate a reference hash for.

§Errors

Returns an error if the event is too large or redaction fails.