feat: bootstrap NAS music deduper

This commit is contained in:
OpenClaw Agent
2026-09-18 04:48:47 +08:00
commit 6154cd0752
17 changed files with 481 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
from pathlib import Path
from am_deduper.hashing import fast_hash, sha256
def test_fast_hash_same_content(tmp_path: Path):
a = tmp_path / "a.bin"
b = tmp_path / "b.bin"
data = b"x" * 200_000
a.write_bytes(data)
b.write_bytes(data)
assert fast_hash(a) == fast_hash(b)
assert sha256(a) == sha256(b)
def test_fast_hash_uses_size(tmp_path: Path):
a = tmp_path / "a.bin"
b = tmp_path / "b.bin"
a.write_bytes(b"x" * 100)
b.write_bytes(b"x" * 101)
assert fast_hash(a) != fast_hash(b)