# Base64

Category: Security
|
Runtime: 0.9+
|
Available: Free

# Overview

Base64 node does the encoding and decoding of a content following the Base64 encoding schemes. This node is primarily used when there is a need to encode binary data that needs be stored and transferred over media that are designed to deal with textual data.

# Setup

# Prerequisites

Not applicable

# Installation

To install the node from designer:

  1. Go to Add more nodes option on the palette section.
  2. Check for the Base64 node and click install.
  3. Once installed, the designer is required to be restarted.

To install the node from CLI:

  1. Go to your project workspace where you can see your package.json file.
  2. Run the below give npm command.
    npm i @kumologica/kumologica-contrib-base64

# Technical Details

Properties

  • Operation (Optional)
    Option for encoding or decoding a message property.
  • Property (Required)
    Variable or Payload which is to be encoded or decoded based on the operation selected.

Supported Operations

Not Applicable

Throws

Base64 node throws the following exception.

  • Base64 Encoding Failed
  • Base64 Decoding Failed

Returns

Encoded string available under following message structure msg.base64.encodedstring. Similarly, the decoded string will be available under msg.base64.decodedstring. Payload or variables will not be overwritten or enriched by this node.

# Develop a Service

Video tutorial

# Instructions

  1. Drag a drop an EventListener node from the palette to the canvas. Open the settings, configure the following and Save.

    Display Name : POST /encoding
    Event Source : Amazon API gateway
    Verb : POST
    URL : /encoding
    
  2. From the security category add Base64 node to the canvas. Open the settings, configure the following and Save.

    Operation : Decode
    Property : msg.payload.testdata
    
  3. Wire the EventListener node to the Base64 node.

  4. Add a Logger node to the flow and set the Message as msg.payload.testdata to print the encoded value. Click Save.

  5. Add EventListener End node from the palette to the canvas. Open the settings, configure the following and Save.

    Payload : msg.payload.testdata
    

# Try it

Sample Flow with Base64 node