googlemaps
Version:
A simple way to query the Google Maps API from Node.js
20 lines (12 loc) • 340 B
JavaScript
module.exports = function (num) {
var encodeString = '';
var nextValue, finalValue;
while (num >= 0x20) {
nextValue = (0x20 | (num & 0x1f)) + 63;
encodeString += (String.fromCharCode(nextValue));
num >>= 5;
}
finalValue = num + 63;
encodeString += (String.fromCharCode(finalValue));
return encodeString;
};