Python binding for xxHash library providing fast non-cryptographic hash algorithms
Overall
score
80%
Evaluation — 80%
↑ 1.03xAgent success when using this tile
Build a command-line file deduplication tool that identifies duplicate files in a directory by computing and comparing their hashes using multiple hash algorithms.
The tool should:
The tool should be invokable from the command line with the following arguments:
directory: Path to the directory to scan (required)--algorithm: Hash algorithm to use - choices: 32, 64, 128 (required)--output: Output file path for the report (optional, defaults to stdout)32: Use 32-bit hash algorithm64: Use 64-bit hash algorithm128: Use 128-bit hash algorithmThe tool should output JSON with the following structure:
{
"algorithm": "64",
"total_files": 10,
"unique_files": 7,
"duplicate_groups": [
{
"hash": "a1b2c3d4e5f6g7h8",
"files": [
"/path/to/file1.txt",
"/path/to/file2.txt"
]
}
]
}@generates
def compute_file_hash(file_path: str, algorithm: str) -> str:
"""
Compute hash of a file using the specified algorithm.
Args:
file_path: Path to the file to hash
algorithm: Hash algorithm to use ('32', '64', or '128')
Returns:
Hexadecimal hash string
"""
pass
def find_duplicates(directory: str, algorithm: str) -> dict:
"""
Find duplicate files in a directory using the specified hash algorithm.
Args:
directory: Path to directory to scan
algorithm: Hash algorithm to use ('32', '64', or '128')
Returns:
Dictionary with keys: algorithm, total_files, unique_files, duplicate_groups
"""
pass
def main():
"""Main entry point for the command-line tool."""
passProvides fast non-cryptographic hash functions with multiple algorithm variants.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/pypi-xxhashdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10