@andriy-zab/node-red-contrib-double-number
v0.3.0
Published
Internal MPN Node-RED nodes for numeric transforms and pseudo-hash generation.
Downloads
351
Maintainers
Readme
Internal MPN Node Set
Internal Node-RED package that currently contains:
internal-mpn-double-numberinternal-mpn-pseudo-hash
Node Type
internal-mpn-double-numberinternal-mpn-pseudo-hash
Behavior
- Reads
msg.payload - Reads
Multiplierfrom the node configuration - Accepts a finite number or a numeric string
- Multiplies it by the configured multiplier
- Writes the result back to
msg.payload - Sends the message onward
Accepted examples:
21withMultiplier=2->4221withMultiplier=3->63-7withMultiplier=2->-142.5withMultiplier=2->5"21"withMultiplier=2->42" -7 "withMultiplier=2->-14
Rejected examples:
"abc""12px"""nulltrue- invalid configured multipliers such as
"abc"
If msg.payload is not a finite number or numeric string, the node raises an error and does not forward the message.
If Multiplier is not a finite number, the node raises an error and does not forward the message.
Pseudo Hash
The internal-mpn-pseudo-hash node computes a deterministic non-cryptographic uppercase HEX hash from msg.payload.
Behavior:
- converts
msg.payloadto a string - computes a lightweight pseudo-hash inspired by the validated JSONata prototype
- writes the resulting hash string back to
msg.payload
Supported hash lengths:
8163264
Examples:
"abc"withHash Length=8->D72E2140"abc"withHash Length=16->D72E214072DAE913"abc"withHash Length=32->D72E214072DAE91369672A93FB4D8A8F
Important:
- this is not a cryptographic hash
- use it for deterministic internal identifiers, not for security-sensitive workflows
Palette Category
The node is registered under the custom Node-RED palette category:
internal-mpn
Local Development
Install the published package from npm:
cd ~/.node-red
npm install @andriy-zab/node-red-contrib-double-numberThen restart Node-RED.
For local package development from this repository:
From your Node-RED user directory:
cd ~/.node-red
npm install /Projects/test-project-1/plugins/node-red-contrib-internal-mpn-double-numberIf you prefer a symlink-style workflow during development:
cd ~/.node-red/node_modules/@internal-mpn
ln -s /Projects/test-project-1/plugins/node-red-contrib-internal-mpn-double-number node-red-contrib-double-numberExample Flow
Example flow:
Tests
Install dev dependencies and run:
npm test
npm run lint:flow