const fnv = require("fnv-plus"); module.exports.fnvHash = fnvHash; module.exports.toArray32 = toArray32; module.exports.fromArray32 = fromArray32; module.exports.flatArray = flatArray; function toArray32(s,size) { const res = []; //new Uint32Array(size); //has no unshift let rem = BigInt(s); const radix = BigInt(0x100000000); while (rem) { res.unshift( Number(rem % radix)); rem = rem / radix; } if (size) { var i = size - res.length; while (i>0) { res.unshift(0); i--; } } return res; } function fromArray32(arr) { //returns a BigInt var res = BigInt(0); const radix = BigInt(0x100000000); for (let i = 0; i