Base64 to Bytes
Decodes Base64 or Base64URL string into raw byte array
Overview
Decodes a Base64 or Base64URL string (RFC 4648) into a raw byte array (Uint8Array). The decoder automatically normalizes URL-safe characters (- → +, _ → /), ignores whitespace, and restores missing = padding before decoding.
This makes a single node capable of decoding standard padded Base64, unpadded Base64, and URL-safe Base64URL strings without manual reconfiguration.
When to Use
- Decoding Base64-encoded ciphertexts, keys, or JWT/JWE segments into raw
Bytesfor decryption or verification. - Converting Base64 strings from external APIs or configuration files into binary buffers.
Parameter Configuration
This node has no configurable static parameters in the property inspector; its runtime behavior is determined entirely by its algorithm specification and connected ports.
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 (1 total).
| Port Name | Port ID | Data Type | Required | Visibility Condition | Description |
|---|---|---|---|---|---|
Base64 In |
string |
String |
Required | Always visible | Base64 or Base64URL string to decode (with or without = padding). |
Output Ports
Port Nature: Fixed Output Ports (1 total).
| Port Name | Port ID | Data Type | Visibility Condition | Description |
|---|---|---|---|---|
Bytes Out |
bytes |
Bytes |
Always visible | Decoded raw byte array (Uint8Array). |
Error Cases
When any of the following conditions occurs at runtime, this node transitions to an ERROR state and downstream nodes connected to its outputs do not execute.
| Error Code | Default Engine Message | Trigger Condition |
|---|---|---|
INVALID_BASE64_INPUT |
Invalid Base64 string | Raised when the input string contains invalid Base64/Base64URL characters or has an invalid remainder length (len % 4 === 1). |
Examples
Decoding a Base64URL Ciphertext
Decode a URL-safe token back into raw bytes.
- Connect the Base64URL string to the
Base64 Stringinput port. - Connect the
Bytesoutput port to your downstream decrypt or verify node.