Skip to main content
Module

x/json_hash/mod.ts>MerkleHash#compareTo

JCS (JSON Canonicalization Scheme), JSON digests, and JSON Merkle hashes
Latest
method MerkleHash.prototype.compareTo
Re-export
import { MerkleHash } from "https://deno.land/x/json_hash@0.2.0/mod.ts";

Compares two MerkleHash objects. The comparison is done by comparing the hashes in byte order, that is, it's lexicographic.

Parameters

other: MerkleHash<T>

The other MerkleHash to compare.

Returns

number

-1 if this hash goes before the other hash, 0 if they are equal, and 1 if this hash goes after the other hash.