cloudinary-core
Version:
Cloudinary Client Side JS library. Cloudinary streamlines your web application’s image manipulation needs. Cloudinary's cloud-based servers automate image uploading, resizing, cropping, optimizing, sprite generation and more.
18 lines (14 loc) • 351 B
JavaScript
import stringPad from "./stringPad";
let chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
let num = 0;
let map = {};
[...chars].forEach((char) => {
let key = num.toString(2);
key = stringPad(key, 6, '0');
map[key] = char;
num++;
});
/**
* Map of six-bit binary codes to Base64 characters
*/
export default map;