json-thumbprint
v0.0.1
Published
The thumbprint of a JSON based on the JWK Thumbprint
Downloads
5
Readme
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 thecrypto.createHash
function in node.js.options.encoding
- An encoding to return a computed thumbprint. This option passes thehash.digest
method in node.js.
License
MIT