Value Comparator
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
- Verifying that a decrypted plaintext matches the original plaintext in an encryption/decryption round-trip test.
- Comparing a computed HMAC, CMAC, Hash Digest, or CRC against an expected tag, and optionally halting the workflow on mismatch via Treat As Error = false.
Parameter Configuration
| Parameter (ID) | Type & Default | Visibility Condition | Description & Options |
|---|---|---|---|
Comparison Operatoroperator |
selectDefault: == |
Always visible | Relational operator applied to Operand A and Operand B: ==, !=, >, ≥, <, or ≤. (Note: Bool inputs only support == and !=.)
|
Treat As ErrorerrorOnValue |
selectDefault: "" (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.
|
Error CodeerrorCode |
textDefault: "" (empty) |
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 MessageerrorMessage |
textDefault: "" (empty) |
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 Name | Port ID | Data Type | Required | Visibility Condition | Description |
|---|---|---|---|---|---|
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 Name | Port ID | Data Type | Visibility Condition | Description |
|---|---|---|---|---|
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:
- Default Behavior (
Treat As Error = None): Verification or comparison mismatches do not raise a runtime error; instead, the node completes normally and emitsfalse(ortrue) onresultso downstream nodes or scripts can inspect the boolean result. - Reinterpretation as Error (
Treat As Error = falseortrue): When the boolean verdict onresultequals the configurederrorOnValuesetting, the engine transitions this node into anERRORstate using your custom Error Code and Error Message and halts downstream execution.
| Error Code | Trigger Condition |
|---|---|
TYPE_MISMATCH | Raised 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.
- Connect the computed MAC to
Operand Aand the expected MAC toOperand Bwith Comparison Operator set to== (Equal). - Set Treat As Error to
falseand Error Code toMAC_MISMATCHso downstream nodes only execute when the MAC is valid.