This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_"; | |
/** | |
* Encodes a positive integer to a string using a | |
* list of unique characters. | |
* | |
* @param {number} num - Positive integer | |
* @returns {string} Encoded string | |
*/ | |
function encode(num) { |
OlderNewer