From ef21690b12b7cd2c703d69d87d1bad64d69d9146 Mon Sep 17 00:00:00 2001 From: Pierre Date: Mon, 25 May 2026 23:48:03 +0200 Subject: [PATCH] improve doc --- README.md | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 2be716f..5842852 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ To inspect the details of a CID, including its version, codec, multihash and mor ## Installation -This package is part of the Meta Orbit monorepo and uses pnpm workspaces. +This package is part of the MetaMesh monorepo and uses pnpm workspaces. From the monorepo root: ```bash @@ -41,21 +41,21 @@ When using as a dependency in other packages: } ``` -## Usage of ComputeHashIndexCache +## Usage of HashComputerIndexCache To integrate Meta-Hash into your application, follow these steps: 1. **Import the Library**: Import the necessary components from the library. ```typescript -import { ComputeHashIndexCache, CID_ALGORITHM_NAMES } from "./folder-watch-hasher"; +import { HashComputerIndexCache, CID_ALGORITHM_NAMES } from "./folder-watch-hasher"; ``` -2. **Initialize the Watcher**: Create an instance of `ComputeHashIndexCache`, specifying the path to the folder you want to monitor and the hash algorithms you wish to use. +2. **Initialize the Watcher**: Create an instance of `HashComputerIndexCache`, specifying the path to the folder you want to monitor and the hash algorithms you wish to use. ```typescript //note that the csv file will be derived from the path provided into multiple files (one for each algorithm) -const computer = new ComputeHashIndexCache("path/to/your/indexfile/index.csv", [CID_ALGORITHM_NAMES.sha256, CID_ALGORITHM_NAMES.sha1]); +const computer = new HashComputerIndexCache("path/to/your/indexfile/index.csv", [CID_ALGORITHM_NAMES.sha256, CID_ALGORITHM_NAMES.sha1]); ``` 3. **Compute Hashes**: Invoke the `computeMissingHash` method for each file you wish to hash. This method will automatically check the index for existing hashes and compute missing ones. @@ -160,13 +160,6 @@ pnpm test Uses Vitest for unit tests. -## Integration - -Used by: -- **meta-mesh**: File content hashing for deduplication -- **meta-orbit**: Content addressing for distributed storage -- **meta-ui**: Browser-based file verification - ## Performance - **Index Cache**: Avoids rehashing unchanged files (checks size + mtime)