Node.js
Node.js
Base62 Encoding and Decoding
Demonstrates base62 encoding and decoding.Chilkat Node.js Downloads
NODEJS_PRELUDE
function chilkatExample() {
var bd = new chilkat.BinData();
// Base62 encode.
bd.AppendString("hello world","utf-8");
var base62_encoded = bd.GetEncoded("base62");
console.log("hello world --> " + base62_encoded);
// Output:
// hello world --> AAwf93rvy4aWQVw
// Base62 decode
var sb = new chilkat.StringBuilder();
sb.DecodeAndAppend("AAwf93rvy4aWQVw","base62","utf-8");
console.log("decoded: " + sb.GetAsString());
// Output:
// decoded: hello world
}
chilkatExample();