Files
3dverse-testtask/vendor/deno.land/x/base64@v0.2.1/mod.ts
T
didier amyot 1f2ea8b7e5 Added test package in nix flake to automatically run tests.
To be able to do such, it was required to add the vendor directory
to the git project.
2023-06-10 09:33:04 -04:00

22 lines
593 B
TypeScript

import { init } from "./base.ts";
const lookup: string[] = [];
const revLookup: number[] = [];
const code: string =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
for (let i: number = 0, l = code.length; i < l; ++i) {
lookup[i] = code[i];
revLookup[code.charCodeAt(i)] = i;
}
// Support decoding URL-safe base64 strings, as Node.js does.
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
revLookup["-".charCodeAt(0)] = 62;
revLookup["_".charCodeAt(0)] = 63;
export const { byteLength, toUint8Array, fromUint8Array } = init(
lookup,
revLookup,
);