merkle
merkle
#
A tree hashes as the merkle of its entries; every kind of node hashes in its own domain.
call_key(identity, inputs)
#
The key of identity applied to arguments hashing to inputs, in order.
Source code in capturegraph-lib/capturegraph/scratch/hashing/merkle.py
hash_bytes(data, context=LEAF_CONTEXT)
#
The hash of data in context's domain.
hash_tree(path, cache=NO_CACHE)
#
The merkle hash of the file or directory at path.
A file hashes its bytes; a directory hashes its entries in name order, each
as its name, whether it is a directory, and its own hash. Hidden entries
count like any other. A symlink to a file hashes as that file, remembered
under the file's own path. Every file hash the walk computes is handed to
cache in one store_all at the end.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path | str
|
The file or directory to hash. |
required |
cache
|
HashCache
|
Where file hashes are remembered by stat. |
NO_CACHE
|
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If |