feat(smartfs.directory): Add directory treeHash: deterministic content-based hashing of directory trees with streaming and algorithm option

This commit is contained in:
2025-12-02 08:35:37 +00:00
parent c73a931dad
commit ebc7de4503
6 changed files with 242 additions and 28 deletions

View File

@@ -1,5 +1,14 @@
# Changelog
## 2025-12-02 - 1.2.0 - feat(smartfs.directory)
Add directory treeHash: deterministic content-based hashing of directory trees with streaming and algorithm option
- Implement treeHash(options?) on SmartFsDirectory which computes a deterministic hash of a directory tree by hashing relative file paths and streaming file contents (default algorithm: 'sha256').
- Introduce ITreeHashOptions type (algorithm?: string) to allow selecting the hash algorithm (e.g. 'sha256', 'sha512').
- Use Node.js crypto to update the hash incrementally while streaming file data to keep memory usage low.
- Add tests in test/test.node.provider.ts covering treeHash behavior, determinism, algorithm selection, and empty-directory hashing.
- Update README with documentation, examples and explanation of treeHash use cases and behavior.
## 2025-11-30 - 1.1.3 - fix(smartfs.provider.node)
Default createDirectory to recursive=true when option not provided in Node provider