{"_id":"hashery","_rev":"5-f0150b9ba05d7d6e308573f267b336a4","name":"hashery","dist-tags":{"latest":"1.4.0"},"versions":{"1.0.0":{"name":"hashery","version":"1.0.0","keywords":["webcrypto","crypto.subtle","object-hash","hash","hashing","sha256","sha512","digest","deterministic","stable-hash","json-hash","browser-compatible","native-crypto","secure","standards-based","nodejs","typescript","esmodule","lightweight","fast","modern","object"],"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","_id":"hashery@1.0.0","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"homepage":"https://github.com/jaredwray/hashery#readme","bugs":{"url":"https://github.com/jaredwray/hashery/issues"},"dist":{"shasum":"1c24865e6c68874678c379f4ffb84e9153f84e18","tarball":"https://registry.npmjs.org/hashery/-/hashery-1.0.0.tgz","fileCount":11,"integrity":"sha512-ah+O2l/9kuh7tKigRulCT2mxu83US1PEHOiXIAI2h5dHSGurioH9+hWlWIlQOLxr8gtsWA+r7Rr5F+PWTNpb9g==","signatures":[{"sig":"MEUCIQCKQOj5h0NtSwNOLwztAjqiSc0g/FMDTeWhS7djFEKEdAIgHGK/G2YVqYYtHq3ly8cTa7l/kjbEmDnwMHi74ALoaFE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":230448},"main":"dist/node/index.cjs","type":"module","types":"dist/node/index.d.ts","module":"dist/node/index.js","engines":{"node":">=20"},"exports":{".":{"import":"./dist/node/index.js","require":"./dist/node/index.cjs"},"./browser":{"import":"./dist/browser/index.js","default":"./dist/browser/index.global.js"}},"gitHead":"a302ffe0b47be62c596eadd779f2cfba29b353cf","scripts":{"lint":"biome check --write --error-on-warnings","test":"pnpm lint && vitest run --coverage","build":"rimraf ./dist && tsup","clean":"rimraf ./dist ./coverage ./node_modules ./pnpm-lock.yaml ./site/README.md ./site/dist","prepare":"pnpm build","test:ci":"biome check --error-on-warnings && vitest run --coverage","benchmark":"tsx benchmark/hashing.ts","website:build":"rimraf ./site/README.md ./site/dist && pnpm docula","website:serve":"rimraf ./site/README.md ./site/dist && pnpm docula"},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"repository":{"url":"git+https://github.com/jaredwray/hashery.git","type":"git"},"_npmVersion":"10.9.4","description":"Browser Compatible Object Hashing","directories":{},"_nodeVersion":"22.21.1","dependencies":{"hookified":"^1.13.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.6","tsup":"^8.5.0","docula":"^0.31.0","rimraf":"^6.1.0","vitest":"^4.0.8","tinybench":"^5.1.0","typescript":"^5.9.3","@types/node":"^24.10.1","@biomejs/biome":"^2.3.5","@faker-js/faker":"^10.1.0","@vitest/coverage-v8":"^4.0.8","@monstermann/tinybench-pretty-printer":"^0.2.0"},"_npmOperationalInternal":{"tmp":"tmp/hashery_1.0.0_1762936875312_0.8174236906004626","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"hashery","version":"1.1.0","keywords":["webcrypto","crypto.subtle","object-hash","hash","hashing","sha256","sha512","digest","deterministic","stable-hash","json-hash","browser-compatible","native-crypto","secure","standards-based","nodejs","typescript","esmodule","lightweight","fast","modern","object"],"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","_id":"hashery@1.1.0","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"homepage":"https://github.com/jaredwray/hashery#readme","bugs":{"url":"https://github.com/jaredwray/hashery/issues"},"dist":{"shasum":"e73dc9a91f0c21c0dbe34496b97370bb02e87a0a","tarball":"https://registry.npmjs.org/hashery/-/hashery-1.1.0.tgz","fileCount":11,"integrity":"sha512-EyN4e8SXi0UIMcDedVVzxbhRzMhhiFYZUfZezPV7bgW2Q6U6ODgAKbCrq6ipUa6ZbOf7KXBVQ2Y6DbGkfTCEtA==","signatures":[{"sig":"MEQCIHiO0qfDWjY+nS85M8pldb4ng9iVRqvcvoDkCqhioG5hAiAfquL65cujxUB+/NBMOlEPKkS8vzzFp403JQ+eSkHOlw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":254854},"main":"dist/node/index.cjs","type":"module","types":"dist/node/index.d.ts","module":"dist/node/index.js","engines":{"node":">=20"},"exports":{".":{"import":"./dist/node/index.js","require":"./dist/node/index.cjs"},"./browser":{"import":"./dist/browser/index.js","default":"./dist/browser/index.global.js"}},"gitHead":"60cea5cd2a62b598a852d7869f241f6e4777fee6","scripts":{"lint":"biome check --write --error-on-warnings","test":"pnpm lint && vitest run --coverage","build":"rimraf ./dist && tsup","clean":"rimraf ./dist ./coverage ./node_modules ./pnpm-lock.yaml ./site/README.md ./site/dist","prepare":"pnpm build","test:ci":"biome check --error-on-warnings && vitest run --coverage","benchmark":"tsx benchmark/hashing.ts","website:build":"rimraf ./site/README.md ./site/dist && pnpm docula","website:serve":"rimraf ./site/README.md ./site/dist && pnpm docula"},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"repository":{"url":"git+https://github.com/jaredwray/hashery.git","type":"git"},"_npmVersion":"10.9.4","description":"Browser Compatible Object Hashing","directories":{},"_nodeVersion":"22.21.1","dependencies":{"hookified":"^1.13.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.6","tsup":"^8.5.0","docula":"^0.31.0","rimraf":"^6.1.0","vitest":"^4.0.8","tinybench":"^5.1.0","typescript":"^5.9.3","@types/node":"^24.10.1","@biomejs/biome":"^2.3.5","@faker-js/faker":"^10.1.0","@vitest/coverage-v8":"^4.0.8","@monstermann/tinybench-pretty-printer":"^0.2.0"},"_npmOperationalInternal":{"tmp":"tmp/hashery_1.1.0_1762970283221_0.3179244434789823","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"hashery","version":"1.2.0","keywords":["webcrypto","crypto.subtle","object-hash","hash","hashing","sha256","sha512","digest","deterministic","stable-hash","json-hash","browser-compatible","native-crypto","secure","standards-based","nodejs","typescript","esmodule","lightweight","fast","modern","object"],"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","_id":"hashery@1.2.0","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"homepage":"https://github.com/jaredwray/hashery#readme","bugs":{"url":"https://github.com/jaredwray/hashery/issues"},"dist":{"shasum":"a5f865f169aedd964d6e986cd56b03128df9af44","tarball":"https://registry.npmjs.org/hashery/-/hashery-1.2.0.tgz","fileCount":11,"integrity":"sha512-43XJKpwle72Ik5Zpam7MuzRWyNdwwdf6XHlh8wCj2PggvWf+v/Dm5B0dxGZOmddidgeO6Ofu9As/o231Ti/9PA==","signatures":[{"sig":"MEUCIBPtI0LLX5vKUgq223sYFpXvHsytESB17Ko3JKP3k6aAAiEAgPx8wRvkg9nFVm3yOcwL+58XBcA1X+950CHtEkqiIXg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":265299},"main":"dist/node/index.cjs","type":"module","types":"dist/node/index.d.ts","module":"dist/node/index.js","engines":{"node":">=20"},"exports":{".":{"import":"./dist/node/index.js","require":"./dist/node/index.cjs"},"./browser":{"import":"./dist/browser/index.js","default":"./dist/browser/index.global.js"}},"gitHead":"7856ec753fc47db68aba3f439995593f5777b71b","scripts":{"lint":"biome check --write --error-on-warnings","test":"pnpm lint && vitest run --coverage","build":"rimraf ./dist && tsup","clean":"rimraf ./dist ./coverage ./node_modules ./pnpm-lock.yaml ./site/README.md ./site/dist","prepare":"pnpm build","test:ci":"biome check --error-on-warnings && vitest run --coverage","benchmark":"tsx benchmark/hashing.ts","website:build":"rimraf ./site/README.md ./site/dist && pnpm docula","website:serve":"rimraf ./site/README.md ./site/dist && pnpm docula"},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"repository":{"url":"git+https://github.com/jaredwray/hashery.git","type":"git"},"_npmVersion":"10.9.4","description":"Browser Compatible Object Hashing","directories":{},"_nodeVersion":"22.21.1","dependencies":{"hookified":"^1.13.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.6","tsup":"^8.5.0","docula":"^0.31.0","rimraf":"^6.1.0","vitest":"^4.0.8","tinybench":"^5.1.0","typescript":"^5.9.3","@types/node":"^24.10.1","@biomejs/biome":"^2.3.5","@faker-js/faker":"^10.1.0","@vitest/coverage-v8":"^4.0.8","@monstermann/tinybench-pretty-printer":"^0.2.0"},"_npmOperationalInternal":{"tmp":"tmp/hashery_1.2.0_1763058884690_0.8101342782736329","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"hashery","version":"1.3.0","keywords":["webcrypto","object-hash","hash","hashing","sha256","sha384","sha512","djb2","murmur","fnv1","crc32","digest","deterministic","stable-hash","json-hash","browser-compatible","native-crypto","secure","standards-based","esmodule","lightweight","fast","modern"],"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","_id":"hashery@1.3.0","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"homepage":"https://github.com/jaredwray/hashery#readme","bugs":{"url":"https://github.com/jaredwray/hashery/issues"},"dist":{"shasum":"2af169f1698efc92bf9235c4880eec92cc5b5107","tarball":"https://registry.npmjs.org/hashery/-/hashery-1.3.0.tgz","fileCount":11,"integrity":"sha512-fWltioiy5zsSAs9ouEnvhsVJeAXRybGCNNv0lvzpzNOSDbULXRy7ivFWwCCv4I5Am6kSo75hmbsCduOoc2/K4w==","signatures":[{"sig":"MEUCIFpEWFWo4s4fquAFW72HdHk4kFAlSG6QUmy9zL/vQy9TAiEAmrEy53SW7i8PSp+9mSetN7L6I9xctxFLVPfK8xIpIaY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":299472},"main":"dist/node/index.js","type":"module","types":"dist/node/index.d.ts","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/node/index.d.ts","default":"./dist/node/index.js"},"require":{"types":"./dist/node/index.d.cts","default":"./dist/node/index.cjs"}},"./browser":{"import":"./dist/browser/index.js","default":"./dist/browser/index.global.js"}},"gitHead":"39d58a7c76e04a21a193c6d26fd27713b178d42e","scripts":{"lint":"biome check --write --error-on-warnings","test":"pnpm lint && vitest run --coverage","build":"rimraf ./dist && tsup","clean":"rimraf ./dist ./coverage ./node_modules ./pnpm-lock.yaml ./site/README.md ./site/dist","prepare":"pnpm build","test:ci":"biome check --error-on-warnings && vitest run --coverage","benchmark":"tsx benchmark/hashing.ts && tsx benchmark/hashing-no-cache.ts","website:build":"rimraf ./site/README.md ./site/dist && pnpm docula","website:serve":"rimraf ./site/README.md ./site/dist && pnpm docula"},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"repository":{"url":"git+https://github.com/jaredwray/hashery.git","type":"git"},"_npmVersion":"10.9.4","description":"Browser Compatible Object Hashing","directories":{},"_nodeVersion":"22.21.1","dependencies":{"hookified":"^1.13.0"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.20.6","tsup":"^8.5.0","docula":"^0.31.0","rimraf":"^6.1.0","vitest":"^4.0.8","tinybench":"^5.1.0","typescript":"^5.9.3","@types/node":"^24.10.1","@biomejs/biome":"^2.3.5","@faker-js/faker":"^10.1.0","@vitest/coverage-v8":"^4.0.8","@monstermann/tinybench-pretty-printer":"^0.2.0"},"_npmOperationalInternal":{"tmp":"tmp/hashery_1.3.0_1764361432549_0.32058022479733306","host":"s3://npm-registry-packages-npm-production"}},"1.4.0":{"name":"hashery","version":"1.4.0","description":"Browser Compatible Object Hashing","type":"module","main":"dist/node/index.js","types":"dist/node/index.d.ts","exports":{".":{"import":{"types":"./dist/node/index.d.ts","default":"./dist/node/index.js"},"require":{"types":"./dist/node/index.d.cts","default":"./dist/node/index.cjs"}},"./browser":{"import":"./dist/browser/index.js","default":"./dist/browser/index.global.js"}},"repository":{"type":"git","url":"git+https://github.com/jaredwray/hashery.git"},"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"engines":{"node":">=20"},"license":"MIT","scripts":{"clean":"rimraf ./dist ./coverage ./node_modules ./pnpm-lock.yaml ./site/README.md ./site/dist","build":"rimraf ./dist && tsup","prepare":"pnpm build","benchmark":"pnpm benchmark:main && pnpm benchmark:no-cache && pnpm benchmark:node","benchmark:main":"tsx benchmark/hashing.ts","benchmark:no-cache":"tsx benchmark/hashing-no-cache.ts","benchmark:node":"tsx benchmark/hashing-vs-node.ts","lint":"biome check --write --error-on-warnings","test":"pnpm lint && vitest run --coverage","test:ci":"biome check --error-on-warnings && vitest run --coverage","website:build":"rimraf ./site/README.md ./site/dist && pnpm docula","website:serve":"rimraf ./site/README.md ./site/dist && pnpm docula"},"dependencies":{"hookified":"^1.14.0"},"devDependencies":{"@biomejs/biome":"^2.3.10","@faker-js/faker":"^10.1.0","@monstermann/tinybench-pretty-printer":"^0.3.0","@types/node":"^25.0.3","@vitest/coverage-v8":"^4.0.16","docula":"^0.31.0","rimraf":"^6.1.2","tinybench":"^6.0.0","tsup":"^8.5.0","tsx":"^4.21.0","typescript":"^5.9.3","vitest":"^4.0.16"},"keywords":["webcrypto","object-hash","hash","hashing","sha256","sha384","sha512","djb2","murmur","fnv1","crc32","digest","deterministic","stable-hash","json-hash","browser-compatible","native-crypto","secure","standards-based","esmodule","lightweight","fast","modern"],"_id":"hashery@1.4.0","gitHead":"ad980151f07ed9667ddd5c18dc1d0f11919981c1","bugs":{"url":"https://github.com/jaredwray/hashery/issues"},"homepage":"https://github.com/jaredwray/hashery#readme","_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-Wn2i1In6XFxl8Az55kkgnFRiAlIAushzh26PTjL2AKtQcEfXrcLa7Hn5QOWGZEf3LU057P9TwwZjFyxfS1VuvQ==","shasum":"3af04d9af0c63ff2f15a353ee9c2d11fdef7919f","tarball":"https://registry.npmjs.org/hashery/-/hashery-1.4.0.tgz","fileCount":11,"unpackedSize":313384,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEoFODH0Wmf4d2nGlLLzFvT12UdUCg+GAW1cPUY8eKfVAiACH9hxRlEOS1nNTAL8wwfFpeaPr+Up2ZRbwLiH/Y8FLw=="}]},"_npmUser":{"name":"jaredwray","email":"me@jaredwray.com"},"directories":{},"maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/hashery_1.4.0_1767117766663_0.5414122447999803"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-12T08:41:15.311Z","modified":"2025-12-30T18:02:47.030Z","1.0.0":"2025-11-12T08:41:15.488Z","1.1.0":"2025-11-12T17:58:03.396Z","1.2.0":"2025-11-13T18:34:44.875Z","1.3.0":"2025-11-28T20:23:52.737Z","1.4.0":"2025-12-30T18:02:46.835Z"},"bugs":{"url":"https://github.com/jaredwray/hashery/issues"},"author":{"name":"Jared Wray","email":"me@jaredwray.com"},"license":"MIT","homepage":"https://github.com/jaredwray/hashery#readme","keywords":["webcrypto","object-hash","hash","hashing","sha256","sha384","sha512","djb2","murmur","fnv1","crc32","digest","deterministic","stable-hash","json-hash","browser-compatible","native-crypto","secure","standards-based","esmodule","lightweight","fast","modern"],"repository":{"type":"git","url":"git+https://github.com/jaredwray/hashery.git"},"description":"Browser Compatible Object Hashing","maintainers":[{"name":"jaredwray","email":"me@jaredwray.com"}],"readme":"\n\n# hashery\nBrowser / Nodejs Compatible Object Hashing\n\n[](https://github.com/jaredwray/hashery/actions/workflows/tests.yml)\n[](https://codecov.io/gh/jaredwray/hashery)\n[](https://github.com/jaredwray/hashery/blob/master/LICENSE)\n[](https://npmjs.com/package/hashery)\n[](https://www.jsdelivr.com/package/npm/hashery)\n[](https://npmjs.com/package/hashery)\n\n# Features\n- **Simple and Easy Object Hashing** - Object hashing based on multiple algorithms.\n- **Browser and Node.js Compatible** - Built using `WebCrypto` API for both environments\n- **Multiple Hash Algorithms** - Supports SHA-256, SHA-384, SHA-512 (WebCrypto), plus DJB2, FNV1, Murmer, and CRC32\n- **Synchronous & Asynchronous** - Both sync and async methods for flexible integration\n- **Custom Serialization** - Easily replace JSON `parse` and `stringify` with custom functions\n- **Deterministic Hashing** - Generate consistent hashes for the same input\n- **Hash to Number** - Convert hashes to deterministic numbers within a specified range. Great for slot management\n- **Provider System** - Extensible hash provider architecture for custom algorithms\n- **Fuzzy Provider Matching** - Case-insensitive and dash-tolerant algorithm name matching\n- **Hooks Support** - Extends Hookified for event-based functionality\n- **Maintained on a Regular Basis** - Active maintenance and updates\n\n# Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n - [Basic Hashing](#basic-hashing)\n - [Synchronous Hashing](#synchronous-hashing)\n - [Using Different Hash Algorithms](#using-different-hash-algorithms)\n - [Setting a Default Algorithm](#setting-a-default-algorithm)\n - [Truncating Hash Output](#truncating-hash-output)\n - [Hash to Number (Great for Slot Management)](#hash-to-number-great-for-slot-management)\n - [Hash to Number Synchronous](#hash-to-number-synchronous)\n - [Browser Usage](#browser-usage)\n- [Hooks](#hooks)\n - [Warning Events for Invalid Algorithms](#warning-events-for-invalid-algorithms)\n- [Caching](#caching)\n- [Web Crypto](#web-crypto)\n - [Browser Support](#browser-support)\n - [Node.js Support](#nodejs-support)\n- [DJB2 Hashing](#djb2-hashing)\n- [FNV1 Hashing](#fnv1-hashing)\n- [CRC Hashing](#crc-hashing)\n- [API - Properties](#api---properties)\n - [parse](#parse)\n - [stringify](#stringify)\n - [providers](#providers)\n - [names](#names)\n - [defaultAlgorithm](#defaultalgorithm)\n - [defaultAlgorithmSync](#defaultalgorithmsync)\n- [API - Functions](#api---functions)\n - [toHash(data, options?)](#toHashdata-options)\n - [toHashSync(data, options?)](#toHashsyncdata-options)\n - [toNumber(data, options?)](#tonumberdata-options)\n - [toNumberSync(data, options?)](#tonumbersyncdata-options)\n - [loadProviders(providers?, options?)](#loadprovidersproviders-options)\n- [Benchmarks](#benchmarks)\n- [Code of Conduct and Contributing](#code-of-conduct-and-contributing)\n- [License and Copyright](#license-and-copyright)\n\n# Installation\n\n```bash\nnpm install hashery\n```\n\n# Usage\n\n## Basic Hashing\n\n```typescript\nimport { Hashery } from 'hashery';\n\nconst hashery = new Hashery();\n\n// Hash an object (defaults to SHA-256)\nconst hash = await hashery.toHash({ name: 'John', age: 30 });\nconsole.log(hash); // SHA-256 hash string\n\n// Hash a string\nconst stringHash = await hashery.toHash('hello world');\n\n// Hash any value (numbers, arrays, etc.)\nconst numberHash = await hashery.toHash(42);\nconst arrayHash = await hashery.toHash([1, 2, 3, 4, 5]);\n```\n\n## Synchronous Hashing\n\nFor performance-critical applications or when you need to avoid async/await, use the synchronous hashing methods. These work with non-cryptographic hash algorithms (djb2, fnv1, murmer, crc32) and are significantly faster than WebCrypto methods.\n\n```typescript\nimport { Hashery } from 'hashery';\n\nconst hashery = new Hashery();\n\n// Synchronous hash (defaults to djb2)\nconst hash = hashery.toHashSync({ name: 'John', age: 30 });\nconsole.log(hash); // djb2 hash string (8 hex characters)\n\n// Sync with specific algorithm\nconst fnv1Hash = hashery.toHashSync({ data: 'example' }, { algorithm: 'fnv1' });\nconst murmerHash = hashery.toHashSync({ data: 'example' }, { algorithm: 'murmer' });\nconst crcHash = hashery.toHashSync({ data: 'example' }, { algorithm: 'crc32' });\n\n// Note: WebCrypto algorithms (SHA-256, SHA-384, SHA-512) are NOT supported in sync mode\n// This will throw an error:\n// hashery.toHashSync({ data: 'example' }, { algorithm: 'SHA-256' }); // ❌ Error!\n```\n\n## Using Different Hash Algorithms\n\n```typescript\nimport { Hashery } from 'hashery';\n\nconst hashery = new Hashery();\n\n// Use SHA-384\nconst hash384 = await hashery.toHash({ data: 'example' }, { algorithm: 'SHA-384' });\n\n// Use SHA-512\nconst hash512 = await hashery.toHash({ data: 'example' }, { algorithm: 'SHA-512' });\n\n// Use non-crypto hash algorithms\nconst fastHash = await hashery.toHash({ data: 'example' }, { algorithm: 'djb2' });\n```\n\n## Setting a Default Algorithm\n\nYou can set a default algorithm for all hash operations via constructor or property:\n\n```typescript\nimport { Hashery } from 'hashery';\n\n// Set default algorithm via constructor\nconst hashery = new Hashery({ defaultAlgorithm: 'SHA-512' });\n\n// Now all hashes use SHA-512 by default\nconst hash1 = await hashery.toHash({ data: 'example' }); // Uses SHA-512\nconsole.log(hash1.length); // 128 (SHA-512 produces 128 hex characters)\n\n// You can still override it per call\nconst hash2 = await hashery.toHash({ data: 'example' }, { algorithm: 'SHA-256' });\nconsole.log(hash2.length); // 64 (SHA-256 produces 64 hex characters)\n\n// Change default algorithm at runtime\nhashery.defaultAlgorithm = 'djb2';\nconst hash3 = await hashery.toHash({ data: 'example' }); // Uses djb2\n```\n\n## Truncating Hash Output\n\nYou can limit the length of the hash output using the `maxLength` option:\n\n```typescript\nimport { Hashery } from 'hashery';\n\nconst hashery = new Hashery();\n\n// Get a shorter hash (16 characters instead of 64)\nconst shortHash = await hashery.toHash(\n { data: 'example' },\n { algorithm: 'SHA-256', maxLength: 16 }\n);\nconsole.log(shortHash); // \"3f79bb7b435b0518\" (16 chars)\n\n// Full hash for comparison\nconst fullHash = await hashery.toHash({ data: 'example' });\nconsole.log(fullHash); // \"3f79bb7b435b05181e4ccf0d4e8...\" (64 chars)\n```\n\n## Hash to Number (Great for Slot Management)\n\n```typescript\nimport { Hashery } from 'hashery';\n\nconst hashery = new Hashery();\n\n// Convert hash to a number within a range\nconst slot = await hashery.toNumber({ userId: 123 }, { min: 0, max: 100 });\nconsole.log(slot); // Deterministic number between 0-100\n\n// Use for consistent slot assignment\nconst userSlot = await hashery.toNumber({ userId: 'user@example.com' }, { min: 0, max: 9 });\n// Same user will always get the same slot number\n```\n\n## Hash to Number Synchronous\n\nGenerate deterministic numbers synchronously for high-performance scenarios. Perfect for A/B testing, sharding, and load balancing without async overhead.\n\n```typescript\nimport { Hashery } from 'hashery';\n\nconst hashery = new Hashery();\n\n// Synchronous number generation (defaults to djb2)\nconst slot = hashery.toNumberSync({ userId: 123 }, { min: 0, max: 100 });\nconsole.log(slot); // Deterministic number between 0-100\n\n// A/B testing without async/await\nconst variant = hashery.toNumberSync({ userId: 'user123' }, { min: 0, max: 1 });\nconsole.log(variant === 0 ? 'Group A' : 'Group B');\n\n// Load balancing across servers\nconst serverIndex = hashery.toNumberSync(\n { requestId: 'req_abc123' },\n { min: 0, max: 9, algorithm: 'fnv1' } // 10 servers\n);\n\n// Sharding assignment\nconst shardId = hashery.toNumberSync(\n { customerId: 'cust_xyz' },\n { min: 0, max: 15, algorithm: 'murmer' } // 16 shards\n);\n\n// Set default sync algorithm for all sync operations\nconst hashery2 = new Hashery({ defaultAlgorithmSync: 'fnv1' });\nconst num = hashery2.toNumberSync({ data: 'test' }); // Uses fnv1 by default\n```\n\n## Browser Usage\n\nHashery works seamlessly in the browser using the Web Crypto API. You can include it via CDN or bundle it with your application.\n\n### Using via CDN (jsDelivr)\n\n```html\n\n\n