Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

base64-map.js 555B

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