Advertisement
Guest User

Untitled

a guest
Feb 20th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. // z85 alphabet - doesn't include ', ", \
  2. const alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-:+=^!/*?&<>()[]{}@%$#";
  3. const base = alphabet.length;
  4. const base85 = input => {
  5. const result = [];
  6. do {
  7. const remainder = input % base;
  8. input = ~~(input / base);
  9. result.push(alphabet[remainder]);
  10. } while (input != 0);
  11. return result.reverse().join("");
  12. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement