jon.recoil.org

Module OpamHashSource

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

Stored as hexadecimal strings

Sourcetype t
Sourceval all_kinds : OpamHash.kind list

The list of all the possible values of kind

Sourceval contents : OpamHash.t -> string

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

Sourceval string_of_kind : OpamHash.kind -> string
Sourceval md5 : string -> OpamHash.t
Sourceval sha256 : string -> OpamHash.t
Sourceval sha512 : string -> OpamHash.t
include OpamStd.ABSTRACT with type t := OpamHash.t
Sourceval compare : OpamHash.t -> OpamHash.t -> int
Sourceval equal : OpamHash.t -> OpamHash.t -> bool
Sourceval of_string : string -> OpamHash.t
Sourceval to_string : OpamHash.t -> string
Sourcemodule Set : OpamStd.SET with type elt = OpamHash.t
Sourcemodule Map : OpamStd.MAP with type key = OpamHash.t
Sourceval of_string_opt : string -> OpamHash.t option
Sourceval compare_kind : OpamHash.kind -> OpamHash.kind -> int
Sourceval equal_kind : OpamHash.kind -> OpamHash.kind -> bool
Sourceval is_null : OpamHash.t -> bool

Check if hash contains only 0

Sourceval to_path : OpamHash.t -> string list

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

Sourceval sort : OpamHash.t list -> OpamHash.t list

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

Sourceval check_file : string -> OpamHash.t -> bool

Compute the hash of the file and check it

Sourceval check_string : string -> OpamHash.t -> bool

Compute the hash of the string and check it

Sourceval mismatch : string -> OpamHash.t -> OpamHash.t option

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

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

Compute hash of the given file

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

Compute the hash of the given string