package lsp

  1. Overview
  2. Docs

doc/lsp.stdune/Stdune/Digest/index.html

Module Stdune.DigestSource

Digests (MD5)

Sourcetype t
include Comparable_intf.S with type key := t
Sourcemodule Map : sig ... end
Sourcemodule Set : sig ... end
Sourceval to_dyn : t -> Dyn.t
Sourceval hash : t -> int
Sourceval equal : t -> t -> bool
Sourceval compare : t -> t -> Ordering.t
Sourceval to_string : t -> string
Sourceval from_hex : string -> t option
Sourceval file : Path.t -> t
Sourceval string : string -> t
Sourceval to_string_raw : t -> string
Sourceval generic : 'a -> t
Sourcemodule Stats_for_digest : sig ... end

The subset of fields of Unix.stats used by this module.

Sourcemodule Path_digest_result : sig ... end
Sourceval path_with_stats : allow_dirs:bool -> Path.t -> Stats_for_digest.t -> Path_digest_result.t

Digest a path taking into account its Stats_for_digest.

  • If it's a regular file, the resulting digest includes the file's content as well as the its executable permissions bit.
  • If it's a directory and allow_dirs = true, the function computes the digest of Stats_for_digest (except for the st_kind field since it's known to be S_DIR in this case). This is a poor approach to computing directory digests and we are planning to get rid of it soon.
  • Otherwise, the function returns Unexpected_kind.

Note that this interface is prone to races: the provided Stats_for_digest may get stale, so path_with_stats may return Unix_error (ENOENT, _, _) even though you've just successfully run Path.stat on it. The call sites are expected to gracefully handle such races.

Sourceval file_with_executable_bit : executable:bool -> Path.t -> t

Digest a file taking the executable bit into account. Should not be called on a directory.

Sourceval override_impl : file:(string -> t) -> string:(string -> t) -> unit

Override the implementations of digest computation. Can be used to record the reverse digest map.

Sourcemodule Direct_impl : sig ... end

Direct_impl does a plain hashing, with no heed to the overrides given by override_impl.

OCaml

Innovation. Community. Security.