- .github
- .editorconfig145 B
- .gitignore139 B
- index.spec.ts3.4 KB
- index.ts1.2 KB
- licence1.1 KB
- package.json595 B
- pnpm-lock.yaml11 KB
- readme.md1.5 KB
- rollup.config.js1.1 KB
- tsconfig.json218 B
readme.md
โก Features
-
โ Intuitive
-
๐ช Recursive/Circular support
-
๐ Performant โ TBD benchmarks
-
๐ชถ Lightweight โ a mere 503B and no dependencies.
๐ Usage
import { createHash } from 'node:crypto';
import { identify } from 'object-identity';
// ~> Some user defined hasher
const hasher = (value) => createHash('sha1').update(value).digest('hex');
// Lets hash the object
const hashA = identify({ a: "b" }, hasher);
const hashB = identify({ a: "b" }, hasher);
expect(hashA).toEqual(hashB);
License
MIT ยฉ Marais Rossouw