node-red-contrib-checksum

1.3.1 • Public • Published

node-red-contrib-checksum

A simple checksum utility for Node-RED, based on crypto-js. Supports MD5, SHA-1, SHA-512, SHA-384, SHA-256, SHA-224, Keccak (at 512, 384, 256 or 224 bits) and RIPEMD-160.

Prerequisites

Node-RED installed. Latest version should work fine.

Installation

Install via Node-RED Manage Palette

node-red-contrib-checksum

Install via npm

$ cd ~/.node-red
$ npm install node-red-contrib-checksum

If necessary, restart Node-RED.

How to use

There are 5 options in the Properties tab of the node:

  • File/String: string, or path to the file, to be hashed;
  • Checksum: hash string, or path to the file with it, to compare with the hashing result;
  • Hash function: allows to choose the necessary function between those supported;
  • The input payload is a file: specifies if 'File/String' contains a string to be passed directly to the function or a path to a file that has to be read first;
  • The input checksum is a file: specifies if 'Checksum' contains a string to be passed directly to the function or a path to a file containing the hash.

The first 3 fields can be specified using strings or the msg attributes containing the value. In case of the hash function, the value provided must be a string and one of the hash functions listed as supported.

The node returns a boolean if everything works correctly: true if the checksum given matches the one obtained from the hash function, false otherwise. In the "msg.calcChecksum" field is also returned the calculated checksum,regardless the result of the comparison.

Examples

As an implementation example with files, see this flow.

Contribution

Feel free to add more options or whatever may be of use.

Package Sidebar

Install

npm i node-red-contrib-checksum

Weekly Downloads

36

Version

1.3.1

License

none

Unpacked Size

28.8 kB

Total Files

7

Last publish

Collaborators

  • edogimo