Skip to main content
Version: 1.4.0

Binary Decode

Parse Data Analysis

Synopsis

Decodes binary strings (e.g., "01000001") to ASCII (e.g., "A").

Schema

- binary_decode:
field: <ident>
target_field: <string>
input_format: <string>
output_format: <string>
encoding: <string>
bits_per_char: <integer>
delimiter: <string>
description: <text>
if: <script>
ignore_failure: <boolean>
ignore_missing: <boolean>
on_failure: <processor[]>
on_success: <processor[]>
tag: <string>

Configuration

The following fields are used to define the processor:

FieldRequiredDefaultDescription
fieldY-Source field containing binary data to decode
target_fieldNSame as fieldTarget field to store decoded result
input_formatNbinaryInput data format: binary, hex, decimal, octal
output_formatNstringOutput format: string, hex, decimal, bytes
encodingNutf8Character encoding: utf8, ascii, utf16le, utf16be
bits_per_charN8 (or 7 for ASCII)Number of bits per character
delimiterN-Custom delimiter for binary string separation
descriptionN-Explanatory note
ifN-Condition to run
ignore_failureNfalseContinue processing if decoding fails
ignore_missingNfalseSkip processing if referenced field doesn't exist
on_failureN-See Handling Failures
on_successN-See Handling Success
tagN-Identifier

Details

Converts binary data from various input formats to specified output formats. The processor supports multiple input formats including binary strings, hexadecimal, decimal, and octal representations.

The processor automatically handles common separators in binary strings (spaces, commas, dashes, underscores) and can process both individual strings and arrays of strings.

note

When processing binary strings, the processor automatically pads input with leading zeros if the string length is not a multiple of bits_per_char. This ensures proper character alignment.

The encoding parameter determines how the decoded bytes are interpreted as characters. UTF-8 is the default and most common encoding, while ASCII is limited to 7-bit characters.

warning

If the input contains invalid characters for the specified format (e.g., non-binary digits in binary format), the processor will fail unless ignore_failure is set to true.

Examples

Basic Binary to ASCII

Converting binary string to ASCII text...

{
"binary_data": "0100100001100101011011000110110001101111"
}
- binary_decode:
field: binary_data
target_field: text_result

decodes to readable text:

{
"binary_data": "0100100001100101011011000110110001101111",
"text_result": "Hello"
}

Hexadecimal Input

Converting hexadecimal to ASCII string...

{
"hex_value": "48656C6C6F20576F726C64"
}
- binary_decode:
field: hex_value
input_format: hex
target_field: decoded_text

converts hex to readable text:

{
"hex_value": "48656C6C6F20576F726C64",
"decoded_text": "Hello World"
}

Spaced Binary String

Processing binary with space separators...

{
"spaced_binary": "01000001 01000010 01000011"
}
- binary_decode:
field: spaced_binary
target_field: letters

automatically handles separators:

{
"spaced_binary": "01000001 01000010 01000011",
"letters": "ABC"
}

Array Processing

Decoding multiple binary strings from array...

{
"binary_array": [
"0100100001101001",
"01000010011110010110010101110100"
]
}
- binary_decode:
field: binary_array
target_field: decoded_array

processes each array element:

{
"binary_array": [...],
"decoded_array": [
"Hi",
"Bye"
]
}

Output to Hex Format

Converting binary input to hex output...

{
"binary_input": "0100100001100101011011000110110001101111"
}
- binary_decode:
field: binary_input
output_format: hex
target_field: hex_output

outputs in hexadecimal format:

{
"binary_input": "0100100001100101011011000110110001101111",
"hex_output": "48656c6c6f"
}