archivebox.misc.hashing
Module Contents
Functions
Internal function to calculate file hash with cache key based on path, size and mtime. |
|
Calculate SHA256 hash of a file with caching based on path, size and mtime. |
|
Calculate SHA256 hashes for all files and directories recursively. |
|
Get filtered list of directory entries. |
|
Calculate sizes for all files and directories recursively. |
|
Get detailed information about directory contents including hashes and sizes. |
API
- archivebox.misc.hashing._cached_file_hash(filepath: str, size: int, mtime: float) str[source]
Internal function to calculate file hash with cache key based on path, size and mtime.
- archivebox.misc.hashing.hash_file(file_path: pathlib.Path, pwd: pathlib.Path | None = None) str[source]
Calculate SHA256 hash of a file with caching based on path, size and mtime.
- archivebox.misc.hashing.get_dir_hashes(dir_path: pathlib.Path, pwd: pathlib.Path | None = None, filter_func: collections.abc.Callable | None = None, max_depth: int = -1) dict[str, str][source]
Calculate SHA256 hashes for all files and directories recursively.
- archivebox.misc.hashing.get_dir_entries(dir_path: pathlib.Path, pwd: pathlib.Path | None = None, recursive: bool = True, include_files: bool = True, include_dirs: bool = True, include_hidden: bool = False, filter_func: collections.abc.Callable | None = None, max_depth: int = -1) tuple[str, ...][source]
Get filtered list of directory entries.