package swhid_core

  1. Overview
  2. Docs

Module to work with the hash component of a swhid.

type t

The type of hashes.

val compare : t -> t -> int

compare x y returns 0 if x is equal to y, a negative integer if x is less than y, and a positive integer if x is greater than y.

val equal : t -> t -> bool

equal x y returns true iff x is equal to y.

val of_string : string -> (t, string) Stdlib.result

of_string s is Ok v if s is a valid hash, otherwise it is Error e. A hash is valid if it's made of 40 hexadecimal characters.

val pp : Stdlib.Format.formatter -> t -> unit

pp fmt v prints v on formatter fmt.

val to_string : t -> string

to_string v is the representation of v as a string.