DraviaVemal / JSON-Signature

JSON Signer offers a robust solution for signing JSON content with SHA256, providing developers with a reliable method to ensure getting identical signature for the same payload even when the json key shape get changes during string conversion

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JSON-Signature Generator

This package enables the generation of unique hash signatures for provided payloads. It normalise json key order so the same payload data with different key order generates same key.

Installation

You can install this package via pip:

npm i json-signature

Usage

import { JsonSignature } from "json-signature";

console.log(
  JsonSignature.GetSignatureForData(
    {
      key1: "value1",
      key2: "value2",
      array_key: [1, 2, 3],
    },
    {
      hashType: "sha256",
      digestType: "hex",
      ignoreArrayOrder: true,
    }
  )
);

Contribution

Contributions are welcome! If you encounter issues or have suggestions for improvements, feel free to open an issue or submit a pull request on GitHub.

License

This package is licensed under the MIT License.

Contact

For inquiries or support, please contact contact@draviavemal.com.

About

JSON Signer offers a robust solution for signing JSON content with SHA256, providing developers with a reliable method to ensure getting identical signature for the same payload even when the json key shape get changes during string conversion

License:MIT License


Languages

Language:TypeScript 100.0%