Module Conex_resource.Digest

type alg = [
| `SHA256
]

The sum type of supported digest algorithms.

type t = alg * string

A digest is a pair of digest algorithm and value.

val pp : t Conex_utils.fmt

pp digest is a pretty printer for digest.

val compare : t -> t -> int

compare a b compares a and b, returns 0 if equal, -1 if smaller, 1 if bigger.

val equal : t -> t -> bool

equal a b is true when a and b use the same algorithm type, and have the same value.

val of_wire : Wire.s -> (terr) Stdlib.result

of_wire w converts w to a digest or error.

val wire_raw : t -> Wire.s

wire_raw t is the wire representation of t.

val of_string : string -> (terr) Stdlib.result

of_string str is t or an error.

val to_string : t -> string

to_string digest is the string representing the digest.