1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 05:01:48 +02:00

Merge pull request #10086 from ShamrockLee/hash-algorithm-rename

treewide: hash type -> hash algorithm
This commit is contained in:
John Ericson 2024-02-26 08:37:09 -05:00 committed by GitHub
commit 62a13c8101
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 17 additions and 17 deletions

View file

@ -63,10 +63,10 @@ void restorePath(
HashResult hashPath(
SourceAccessor & accessor, const CanonPath & path,
FileIngestionMethod method, HashAlgorithm ht,
FileIngestionMethod method, HashAlgorithm ha,
PathFilter & filter)
{
HashSink sink { ht };
HashSink sink { ha };
dumpPath(accessor, path, sink, method, filter);
return sink.finish();
}

View file

@ -63,11 +63,11 @@ void restorePath(
* Compute the hash of the given file system object according to the
* given method.
*
* The hash is defined as (essentially) hashString(ht, dumpPath(path)).
* The hash is defined as (essentially) hashString(ha, dumpPath(path)).
*/
HashResult hashPath(
SourceAccessor & accessor, const CanonPath & path,
FileIngestionMethod method, HashAlgorithm ht,
FileIngestionMethod method, HashAlgorithm ha,
PathFilter & filter = defaultPathFilter);
}

View file

@ -274,7 +274,7 @@ Hash newHashAllowEmpty(std::string_view hashStr, std::optional<HashAlgorithm> ha
{
if (hashStr.empty()) {
if (!ha)
throw BadHash("empty hash requires explicit hash type");
throw BadHash("empty hash requires explicit hash algorithm");
Hash h(*ha);
warn("found empty hash, assuming '%s'", h.to_string(HashFormat::SRI, true));
return h;

View file

@ -58,7 +58,7 @@ struct Hash
* Parse the hash from a string representation in the format
* "[<type>:]<base16|base32|base64>" or "<type>-<base64>" (a
* Subresource Integrity hash expression). If the 'type' argument
* is not present, then the hash type must be specified in the
* is not present, then the hash algorithm must be specified in the
* string.
*/
static Hash parseAny(std::string_view s, std::optional<HashAlgorithm> optAlgo);
@ -200,7 +200,7 @@ std::optional<HashFormat> parseHashFormatOpt(std::string_view hashFormatName);
std::string_view printHashFormat(HashFormat hashFormat);
/**
* Parse a string representing a hash type.
* Parse a string representing a hash algorithm.
*/
HashAlgorithm parseHashAlgo(std::string_view s);