archivebox.misc.hashing
Module Contents
Functions
Internal function to calculate file hashes with cache key based on path, size and mtime. |
|
Calculate SHA256 and BLAKE3 hashes of a file with caching based on path, size and mtime. |
|
Calculate SHA256 and BLAKE3 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 both hash types and sizes. |
API
- archivebox.misc.hashing._cached_file_hashes(filepath: str, size: int, mtime: float) tuple[str, str] [source]
Internal function to calculate file hashes with cache key based on path, size and mtime.
- archivebox.misc.hashing.hash_file(file_path: pathlib.Path, pwd: pathlib.Path | None = None) tuple[str, str] [source]
Calculate SHA256 and BLAKE3 hashes 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: Callable | None = None, max_depth: int = -1) dict[str, tuple[str, str]] [source]
Calculate SHA256 and BLAKE3 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: Callable | None = None, max_depth: int = -1) tuple[str, ...] [source]
Get filtered list of directory entries.