@wtasnorg/node-lib / decode
decode(
input,charset?):string
Defined in: base64.ts:119
Decode a Base64 string.
string
The Base64 encoded string.
The charset variant to use (default: “standard”).
"standard" |
"urlsafe" |
"imap" |
"radix64" |
string
The decoded string.
import { decode } from "./base64.js";
decode("SGVsbG8sIFdvcmxkIQ==");
// => "Hello, World!"
decode("SGVsbG8sIFdvcmxkIQ==", "standard");
// => "Hello, World!"
Error if the input contains invalid characters.