Cheatsheet: Data Structures
    Array / List
    Map / Dict
    Set
    Tuple
    Struct / Data Class
    Stacks
    Other Data Structures
    Collection Conversions
Cheatsheet: Control Flow
Cheatsheet: Class

Polyglot CheatSheet - Base64

Updated: 2022-03-26

Node.js

Encoding

import { Buffer } from 'buffer';
var b = new Buffer("JavaScript");
var s = b.toString("base64");
// SmF2YVNjcmlwdA==

Decoding

var b = new Buffer("SmF2YVNjcmlwdA==", "base64");
var s = b.toString();
// JavaScript

To Hex

var b = new Buffer("SmF2YVNjcmlwdA==", "base64");
var s = b.toString("hex");
// 4a617661536372697074

From Hex

var b = new Buffer("4a617661536372697074", "hex");
var s = b.toString("utf8");
// JavaScript