lib/format.js
function encodeAddress(str) {

    /* Check avalibility of evt_address */
    if (typeof str !== "string" || str.length !== 53 || !str.startsWith("EVT")) throw new Error("EVTAddress should be a string with length 53 starts with EVT.");
    str = str.substr(3);

    if (str === "0".repeat(50)) return Buffer.from([0, 0]); // 0000
    else if (str[0] === "0") return encodeGeneratedAddressToBin("EVT" + str); // generated address
    var buf = Buffer.concat([Buffer.from([1, 0]), new Buffer(base58.decode(str))]); // normal
    //console.log(buf)
    return buf.slice(0, buf.length - 4);
}
function encodeAddress(str) {

    /* Check avalibility of evt_address */
    if (typeof str !== "string" || str.length !== 53 || !str.startsWith("EVT")) throw new Error("EVTAddress should be a string with length 53 starts with EVT.");
    str = str.substr(3);

    if (str === "0".repeat(50)) return Buffer.from([0, 0]); // 0000
    else if (str[0] === "0") return encodeGeneratedAddressToBin("EVT" + str); // generated address
    var buf = Buffer.concat([Buffer.from([1, 0]), new Buffer(base58.decode(str))]); // normal
    //console.log(buf)
    return buf.slice(0, buf.length - 4);
}
/* Encode EVT Address in address.cpp