package opam-core

  1. Overview
  2. Docs

doc/opam-core/OpamHash/index.html

Module OpamHashSource

Sourcetype kind = [
  1. | `MD5
  2. | `SHA256
  3. | `SHA512
]

Stored as hexadecimal strings

Sourcetype t
Sourceval kind : t -> kind
Sourceval contents : t -> string

The value of the hash, as a string of hexadecimal characters

Sourceval string_of_kind : kind -> string
Sourceval md5 : string -> t
Sourceval sha256 : string -> t
Sourceval sha512 : string -> t
include OpamStd.ABSTRACT with type t := t
Sourceval of_string : string -> t
Sourceval to_string : t -> string
Sourceval to_json : t -> OpamJson.t
Sourcemodule Set : OpamStd.SET with type elt = t
Sourcemodule Map : OpamStd.MAP with type key = t
Sourceval of_string_opt : string -> t option
Sourceval to_path : t -> string list

returns a sub-path specific to this hash, e.g. "md5/d4/d41d8cd98f00b204e9800998ecf8427e", as a list

Sourceval check_file : string -> t -> bool
Sourceval mismatch : string -> t -> t option

Like check_file, but returns the actual mismatching hash of the file, or None in case of match

Sourceval compute : ?kind:kind -> string -> t

Compute hash of the given file

Sourceval compute_from_string : ?kind:kind -> string -> t

Compute the hash of the given string

OCaml

Innovation. Community. Security.