UNPKG

@technobuddha/library

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