Improve internal API docs for two file hashing functions

Co-Authored-By: Matthew Bauer <mjbauer95@gmail.com>
Co-Authored-By: Carlo Nucera <carlo.nucera@protonmail.com>
This commit is contained in:
John Ericson 2023-09-07 22:52:57 -04:00
parent f89b84919c
commit 39ba81a4eb

View file

@ -145,13 +145,17 @@ std::string printHash16or32(const Hash & hash);
Hash hashString(HashType ht, std::string_view s);
/**
* Compute the hash of the given file.
* Compute the hash of the given file, hashing its contents directly.
*
* (Metadata, such as the executable permission bit, is ignored.)
*/
Hash hashFile(HashType ht, const Path & path);
/**
* Compute the hash of the given path. The hash is defined as
* (essentially) hashString(ht, dumpPath(path)).
* Compute the hash of the given path, serializing as a Nix Archive and
* then hashing that.
*
* The hash is defined as (essentially) hashString(ht, dumpPath(path)).
*/
typedef std::pair<Hash, uint64_t> HashResult;
HashResult hashPath(HashType ht, const Path & path,