text: var alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
  var base = alphabet.length;
  
  function encode(num) {
    var encoded = "";
    while (num) {
      var remainder = num % base;
      num = Math.floor(num / base);
      encoded = alphabet[remainder].toString() + encoded;
    }
    return encoded;
  }
  
  function decode(str) {
    var decoded = 0;
    while (str) {
      var index = alphabet.indexOf(str[0]);
      var power = str.length - 1;
      decoded += index * Math.pow(base, power);
      str = str.substring(1);
    }
    return decoded;
  }
  