// Converts a list of integer values to binary transaction data std::string encodeDatalist(std::vector<std::string> vals) { std::string o; for (unsigned i = 0; i < vals.size(); i++) { std::vector<Node> n = toByteArr(strToNumeric(vals[i]), Metadata(), 32); for (unsigned j = 0; j < n.size(); j++) { int v = decimalToUnsigned(n[j].val); o += (char)v; } } return o; }
//Normalizes number representations Node nodeToNumeric(Node node) { std::string o = strToNumeric(node.val); return token(o == "" ? node.val : o, node.metadata); }
// Does the node contain a number (eg. 124, 0xf012c, "george") bool isNumberLike(Node node) { if (node.type == ASTNODE) return false; return strToNumeric(node.val) != ""; }