json-thumbprint

0.0.1 • Public • Published

json-thumbprint

The thumbprint of a JSON based on RFC 7638 - JSON Web Key (JWK) Thumbprint.

Example

import { thumbprint } from 'json-thumbprint';
 
const json = { x: 1, y: 2 };
 
const result = thumbprint(json, { algorithm: 'sha256', encoding: 'hex' });

API

thumbprint(json, options)

This function computes the thumbprint of the specified object.

Arguments

  • json - An object to obtain a thumbprint.
  • options.algorithm - A hash algorithm to compute a thumbprint. This option passes the crypto.createHash function in node.js.
  • options.encoding - An encoding to return a computed thumbprint. This option passes the hash.digest method in node.js.

License

MIT

Dependents (1)

Package Sidebar

Install

npm i json-thumbprint

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • nak2k