Initializes the Canonicalization class with the specified algorithm.
The canonicalization algorithm to use ('jcs' or 'rdfc').
Gets the canonicalization algorithm.
The current canonicalization algorithm.
Sets the canonicalization algorithm.
Either 'jcs' or 'rdfc'.
Step 3.2: Encodes HashBytes (Uint8Array) to a base58btc string.
The hash as a Uint8Array.
The hash as a hex string.
Canonicalizes an object, hashes it and returns it as hash bytes. Step 1-2: Canonicalize → Hash.
The object to process.
The final SHA-256 hash bytes.
Step 1: Uses this.algorithm to determine the method (JCS/RDFC).
The object to canonicalize.
The canonicalized object.
Step 3: Encodes SHA-256 hashed, canonicalized object as a hex or base58 string.
The canonicalized object to encode.
The encoding format ('hex' or 'base58').
The encoded string.
Step 2: SHA-256 hashes a canonicalized object.
The canonicalized object.
The SHA-256 HashBytes (Uint8Array).
Computes the SHA-256 hashes of canonicalized object and encodes it as a base58 string. Step 2-3: Hash → Encode(base58).
The canonicalized object to hash.
The SHA-256 hash as a base58 string.
Computes the SHA-256 hash of a canonicalized object and encodes it as a hex string. Step 2-3: Hash → Encode(Hex).
The canonicalized object to hash.
The SHA-256 hash as a hex string.
Step 3.1: Encodes HashBytes (Uint8Array) to a hex string.
The hash as a Uint8Array.
The hash as a hex string.
Step 1: Canonicalizes an object using JCS (JSON Canonicalization Scheme).
The object to canonicalize.
The canonicalized object.
Implements 9.2 JSON Canonicalization and Hash.
A macro function that takes in a JSON document, document, and canonicalizes it following the JSON Canonicalization Scheme. The function returns the canonicalizedBytes.
Optionally encodes a sha256 hashed canonicalized JSON object. Step 1 Canonicalize (JCS/RDFC) → Step 2 Hash (SHA256) → Step 3 Encode (Hex/Base58).
The object to process.
The encoding format ('hex' or 'base58').
The final SHA-256 hash bytes as a hex string.
Step 1: Canonicalizes an object using RDF Canonicalization (RDFC).
The object to canonicalize.
The canonicalized object.
Canonicalization class provides methods for canonicalizing JSON objects and hashing them using SHA-256. It supports different canonicalization algorithms and encoding formats (hex and base58). Canonicalization