package opam-core

  1. Overview
  2. Docs

Module OpamHashSource

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

Stored as hexadecimal strings

Sourcetype t
Sourceval kind : t -> kind
Sourceval all_kinds : kind list

The list of all the possible values of 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 compare : t -> t -> int
Sourceval equal : t -> t -> bool
Sourceval of_string : string -> t
Sourceval to_string : t -> string
Sourcemodule Set : OpamStd.SET with type elt = t
Sourcemodule Map : OpamStd.MAP with type key = t
Sourceval of_string_opt : string -> t option
Sourceval compare_kind : kind -> kind -> int
Sourceval is_null : t -> bool

Check if hash contains only 0

Sourceval to_path : t -> string list

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

Sourceval sort : t list -> t list

Sorts the list from best hash (SHA512, ...) to weakest (..., MD5)

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.