node-object-hash
- Version 3.1.1
- Published
- 73 kB
- No dependencies
- MIT license
Install
npm i node-object-hash
yarn add node-object-hash
pnpm add node-object-hash
Overview
Node.js object hash library with properties/arrays sorting to provide constant hashes
Index
Functions
function hasher
hasher: (options?: HasherOptions) => Hasher;
Hasher constructor
Parameter options
hasher options hasher instance
Interfaces
interface Hashable
interface Hashable {}
If object implements Hashable interface then value from toHash will be used for hash function. It means that the different objects with the function toHash that return the same value will have the same hash
property toHashableString
toHashableString: () => string;
interface Hasher
interface Hasher<T = unknown> {}
method hash
hash: (object: Hashable | T, opts?: HasherOptions) => string;
Create hash of an object
Parameter object
source object
Returns
hash string of an object
method sort
sort: (object: T) => string;
Create sorted string from an object
Parameter object
source object
Returns
sorted string from an object
method sortObject
sortObject: (object: T) => string;
Create sorted string from an object
Parameter object
source object
Returns
sorted string from an object sort
interface HasherOptions
interface HasherOptions extends SorterOptions {}
Object hasher options
Package Files (1)
Dependencies (0)
No dependencies.
Dev Dependencies (38)
- @jest/globals
- @semantic-release/changelog
- @semantic-release/commit-analyzer
- @semantic-release/exec
- @semantic-release/git
- @semantic-release/github
- @semantic-release/npm
- @semantic-release/release-notes-generator
- @trivago/prettier-plugin-sort-imports
- @tsconfig/node-lts
- @types/node
- @typescript-eslint/eslint-plugin
- @typescript-eslint/parser
- conventional-changelog-cli
- conventional-changelog-conventionalcommits
- eslint
- eslint-config-google
- eslint-config-prettier
- eslint-import-resolver-typescript
- eslint-plugin-filenames
- eslint-plugin-import
- eslint-plugin-jest
- eslint-plugin-node
- eslint-plugin-prettier
- eslint-plugin-security
- jest
- prettier
- prettier-plugin-packagejson
- prettier-plugin-sh
- prettier-plugin-sort-json
- pretty-quick
- semantic-release
- semantic-release-mirror-version
- ts-jest
- typedoc
- typedoc-plugin-markdown
- typedoc-plugin-mdn-links
- typescript
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/node-object-hash
.
- Markdown[](https://www.jsdocs.io/package/node-object-hash)
- HTML<a href="https://www.jsdocs.io/package/node-object-hash"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 2756 ms. - Missing or incorrect documentation? Open an issue for this package.