Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // z85 alphabet - doesn't include ', ", \
- const alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-:+=^!/*?&<>()[]{}@%$#";
- const base = alphabet.length;
- const base85 = input => {
- const result = [];
- do {
- const remainder = input % base;
- input = ~~(input / base);
- result.push(alphabet[remainder]);
- } while (input != 0);
- return result.reverse().join("");
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement