@technobuddha/library
Version:
A large library of useful functions
17 lines • 1.34 kB
JavaScript
import { base64Config, decode } from "./base64.js";
/**
* Decodes a string of data which has been encoded using
* [Base64](https://developer.mozilla.org/en-US/docs/Glossary/Base64) encoding.
*
* You can use the **decodeBase64** method to encode and transmit data which may otherwise cause
* communication problems, then transmit it and use the {@link encodeBase64} method to decode the data again.
* For example, you can encode, transmit, and decode control characters.
* @remarks Whitespace withing the Base64 encoded string is ignored.
* @throws `TypeError` If the input string is not correctly encoded.
* @group Binary
* @category Encoding
*/
export function decodeBase64(input, encoding) {
return encoding ? decode(base64Config, input, encoding) : decode(base64Config, input);
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVjb2RlLWJhc2UtNjQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvZGVjb2RlLWJhc2UtNjQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLEVBQUUsTUFBTSxhQUFhLENBQUM7QUE0Qm5EOzs7Ozs7Ozs7OztHQVdHO0FBQ0gsTUFBTSxVQUFVLFlBQVksQ0FBQyxLQUFhLEVBQUUsUUFBdUI7SUFDakUsT0FBTyxRQUFRLENBQUMsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxZQUFZLEVBQUUsS0FBSyxFQUFFLFFBQVEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxNQUFNLENBQUMsWUFBWSxFQUFFLEtBQUssQ0FBQyxDQUFDO0FBQ3hGLENBQUMifQ==