main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
555 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 | var commonAlphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
---|
3 | var base64Alphabet = commonAlphabet + '+/';
|
---|
4 | var base64UrlAlphabet = commonAlphabet + '-_';
|
---|
5 |
|
---|
6 | var inverse = function (characters) {
|
---|
7 | // TODO: use `Object.create(null)` in `core-js@4`
|
---|
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 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.