Would anyone have a bit of Xojo code to convert an integer into Base 62? I found this bit of javascript at vmix url that does what I need, but I’m NO expert in JS and it makes my head hurt.
Anyone able to quickly translate this into Xojo for me? I’d surely appreciate it!
var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
var alphas = chars.split('');
function callid2shorturl(callid) {
var count = parseInt(callid);
var div = alphas.length;
var result = "";
if (!Number.isInteger(count)) {
return "Invalid number!";
}
var run = 16;
var mod, quot = 0;
while(run--) {
mod = count % div;
quot = Math.floor(count / div);
result = alphas[mod] + result;
console.log("[" + result + "] CNT: " + count + " / " + div + " = " + quot + " % " + mod);
if (quot == 0) {
run = 0;
}
count = quot;
}
return result;
}