1 | 'use strict';
|
2 | var commonAlphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
3 | var base64Alphabet = commonAlphabet + '+/';
|
4 | var base64UrlAlphabet = commonAlphabet + '-_';
|
5 |
|
6 | var inverse = function (characters) {
|
7 |
|
8 | var result = {};
|
9 | var index = 0;
|
10 | for (; index < 64; index++) result[characters.charAt(index)] = index;
|
11 | return result;
|
12 | };
|
13 |
|
14 | module.exports = {
|
15 | i2c: base64Alphabet,
|
16 | c2i: inverse(base64Alphabet),
|
17 | i2cUrl: base64UrlAlphabet,
|
18 | c2iUrl: inverse(base64UrlAlphabet)
|
19 | };
|