package uniq

  1. Overview
  2. Docs
A library which introspect and infer dependencies via codept, ocamlfind and opam

Install

dune-project
 Dependency

Authors

Maintainers

Sources

uniq-0.1.0.tbz
sha256=998588f1053cf03161a4bded6d7f8068c88de497e77fc0bbca81a5234fa444d5
sha512=53d4ee5ad8c01e19a2e1fbda86266768d118f78566b82f0c736338ce2c12258185a5f4dbb90bf0da37a7528098266ec81861bdcfea29e55daa3122a4f3a1daca

doc/uniq.mod/Uniq_digest/module-type-S/index.html

Module type Uniq_digest.SSource

The signature for a hash function that produces digests of length hash_length from character strings, byte arrays, and files.

  • since 5.2
type t = string

The type of digests.

val hash_length : int

The length of digests, in bytes.

val compare : t -> t -> int

Compare two digests, with the same specification as Stdlib.compare.

val equal : t -> t -> bool

Test two digests for equality.

val string : string -> t

Return the digest of the given string.

val bytes : bytes -> t

Return the digest of the given byte sequence.

val substring : string -> int -> int -> t

substring s ofs len returns the digest of the substring of s starting at index ofs and containing len characters.

val subbytes : bytes -> int -> int -> t

subbytes s ofs len returns the digest of the subsequence of s starting at index ofs and containing len bytes.

val channel : in_channel -> int -> t

Read characters from the channel and return their digest. See Digest.channel for the full specification.

val file : string -> t

Return the digest of the file whose name is given.

val output : out_channel -> t -> unit

Write a digest on the given output channel.

val input : in_channel -> t

Read a digest from the given input channel.

val to_hex : t -> string

Return the printable hexadecimal representation of the given digest.

val of_hex : string -> t

Convert a hexadecimal representation back into the corresponding digest.

  • raises Invalid_argument

    if the length of the argument is not 2 * hash_length, or if the arguments contains non-hexadecimal characters.