1 /**
  2  * The MIT License (MIT)
  3  *
  4  * Copyright (c) 2016 DeNA Co., Ltd.
  5  *
  6  * Permission is hereby granted, free of charge, to any person obtaining a copy
  7  * of this software and associated documentation files (the "Software"), to deal
  8  * in the Software without restriction, including without limitation the rights
  9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 10  * copies of the Software, and to permit persons to whom the Software is
 11  * furnished to do so, subject to the following conditions:
 12  *
 13  * The above copyright notice and this permission notice shall be included in
 14  * all copies or substantial portions of the Software.
 15  *
 16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 22  * SOFTWARE.
 23  */
 24 
 25 /// <reference path="base.js"/>
 26 
 27 /**
 28  * A class that defines constants used for encoding an array to base-64 text or
 29  * for decoding base-64 text to an array.
 30  * @constructor
 31  */
 32 createjs.Base64 = function() {
 33 };
 34 
 35 /**
 36  * A conversion table from an integer to a base64 character.
 37  * @const {Array.<string>}
 38  */
 39 createjs.Base64.ENCODE_TABLE = [
 40   'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
 41   'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',
 42   'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X',
 43   'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
 44   'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
 45   'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
 46   'w', 'x', 'y', 'z', '0', '1', '2', '3',
 47   '4', '5', '6', '7', '8', '9', '+', '/'
 48 ];
 49 
 50 /**
 51  * A conversion table from a base64 character to its value.
 52  * @const {Array.<number>}
 53  */
 54 createjs.Base64.DECODE_TABLE = [
 55   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 56   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 57   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 58   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 59   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 60   0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3f,
 61   0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b,
 62   0x3c, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 63   0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06,
 64   0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
 65   0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16,
 66   0x17, 0x18, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00,
 67   0x00, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20,
 68   0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28,
 69   0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30,
 70   0x31, 0x32, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00
 71 ];
 72