NodeCrypto Help

Value Comparator

Category: Utility ยท Node Type ID: utility-compare

Compares two values of the same type (bytes, string, int, bool) with ==, !=, >, >=, <, <=

Overview

Compares two values of the same primitive data type (Bytes, String, Int, or Bool) using one of six relational operators (==, !=, >, ≥, <, ≤) and outputs a boolean verdict on the Result port.

For Bytes, ordering comparisons (>, ≥, <, ≤) compare buffers lexicographically from index 0 using unsigned byte values (0..255), while equality (==, !=) checks whether both buffers have the exact same length and identical bytes. For Bool, only == and != are allowed. Because this node uses a Judgement Error Profile, you can also configure Treat As Error to halt downstream execution with a custom error code whenever the comparison evaluates to false (or true).

When to Use

Parameter Configuration

Parameter (ID)Type & DefaultVisibility ConditionDescription & Options
Comparison Operator
operator
select
Default: ==
Always visible Relational operator applied to Operand A and Operand B: ==, !=, >, ≥, <, or ≤. (Note: Bool inputs only support == and !=.)
  • ==: ==
  • !=: !=
  • >: >
  • >=: >=
  • <: <
  • <=: <=
Treat As Error
errorOnValue
select
Default: "" (empty)
Always visible Judgement error reinterpretation: leave set to None (default) to emit the boolean verdict as normal data, or set to false (or true) to transition the node into an ERROR state when Result matches that value.
  • (empty): None (default; the result is plain data)
  • true: true
  • false: false
Error Code
errorCode
text
Default: "" (empty)
Supports Variable Reference ($var: string)
When errorOnValue is true or false Custom error code reported when Treat As Error triggers (defaults to a node-specific code if left blank). Only visible when Treat As Error is not None.
Error Message
errorMessage
text
Default: "" (empty)
Supports Variable Reference ($var: string)
When errorOnValue is true or false Custom error message reported when Treat As Error triggers. Only visible when Treat As Error is not None.

Port I/O Specification

See Ports & Connections for general wiring rules, data type colors, and dynamic port creation.

Input Ports

Port Nature: Fixed Input Ports (2 total).

Port NamePort IDData TypeRequiredVisibility ConditionDescription
Value A a Any Required Always visible First operand (Bytes, String, Int, or Bool). Must have the same data type as Operand B.
Value B b Any Required Always visible Second operand. Must have the same data type as Operand A.

Output Ports

Port Nature: Fixed Output Ports (1 total).

Port NamePort IDData TypeVisibility ConditionDescription
Result result Bool Always visible Boolean comparison result (true if Operand A [operator] Operand B holds, otherwise false).

Error Cases

This node uses a Judgement Error Profile on its boolean output port result:

Error CodeTrigger Condition
TYPE_MISMATCHRaised when Operand A and Operand B have different runtime data types, or when an ordering operator (>, ≥, <, ≤) is used on Bool values.

Examples

Asserting HMAC Tag Equality and Halting on Mismatch

Compare two MAC tags and fail the workflow if they differ.

  1. Connect the computed MAC to Operand A and the expected MAC to Operand B with Comparison Operator set to == (Equal).
  2. Set Treat As Error to false and Error Code to MAC_MISMATCH so downstream nodes only execute when the MAC is valid.