export function toNumber(quantity) {
    return parseInt(quantity.substring(2), 16)
}


export function parseString(hex) {
    if (typeof hex !== 'string') {
        return null
    }
    //TODO _very_ dumb implementation, and works only for ascii

    hex = hex.substring(2);
    const parts = hex.match(/.{64}/g);
    const len_ignore = parts[0];
    const text_size = parts[1];
    const text_data = hex.substring(64 + 64);
    let result = '';
    for (let i = 0; i < text_size; i++) {
        const pos = i * 2;
        result += String.fromCharCode(parseInt(text_data[pos] + text_data[pos + 1], 16))
    }
    return result
}
@@ -624,8 +624,436 @@
 result%0A%7D
+%0A%0Aexport function getNakedAddress(address) %7B%0A    return address.toLowerCase().replace('0x', '');%0A%7D%0A%0Aexport function padLeft(n, width, z) %7B%0A    z = z %7C%7C '0';%0A    n = n + '';%0A    return n.length %3E= width ? n : new Array(width - n.length + 1).join(z) + n;%0A%7D%0A%0Aexport function getDataObj(to, func, arrVals) %7B%0A    var val=%22%22;%0A    for (var i=0;i%3CarrVals.length;i++) val += padLeft(arrVals%5Bi%5D,64);%0A    return %7Bto: to, data: func+val%7D;%0A%7D

add functions for converting to hex data