move utils code; fix sprintf; implement enc/dec

This commit is contained in:
DavidVentura
2024-01-24 17:13:34 +01:00
parent f00821f8bd
commit ff684361f4
5 changed files with 289 additions and 112 deletions
+9
View File
@@ -37,3 +37,12 @@ DataView.prototype.readByteArray = function (len) {
}
return ret;
};
const Memory = {
alloc: (len) => new DataView(new ArrayBuffer(len + 1)),
copy: (outbuf, inbuf, len) => outbuf.writeByteArray(inbuf.readByteArray(len)),
};
//module.exports = {
// Memory,
//};