Using Polypad, this script encodes plain text to base64. To allow text data to be transmitted with binary data it must be encoded.
What is Base64?
Base64 is a binary to a text encoding scheme that represents binary data in an ASCII string format. It is designed to carry data stored in binary format across the network channels. Base64 mechanism uses 64 characters to encode. These characters consist of:
- 10 Integer values: i.e., 0..9
- 26 Uppercase alphabets: i.e., A..Z
- 26 Lowercase alphabets: i.e., a..z
- 2 special characters (these characters depends on operating system): i.e. +,/
How to use Base64 encode?
Using the base64 encode script with Polypad is very easy. Let’s say we have some text string that we would like to encode. Simply paste the plain text down below into Polypad.
Polypad is awesome!
Press cmd/ctrl + p
depending on your operating system and search for the Base64 Decode
script and select it. The expected output should read:
UG9seXBhZCBpcyBhd2Vzb21lIQ==
Base64 Encoder Code
const { encode } = require('@polypad/base64')
function main(input) {
input.text = encode(input.text)
}
To learn more about Base64, please visit our blog