diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..6079e3d Binary files /dev/null and b/.DS_Store differ diff --git a/commons.js b/commons.js new file mode 100644 index 0000000..e69de29 diff --git a/karma.conf.cjs b/karma.conf.cjs index 893bfde..f7bacea 100644 --- a/karma.conf.cjs +++ b/karma.conf.cjs @@ -5,9 +5,7 @@ const path = require("path"); const ResolveTypeScriptPlugin = require("resolve-typescript-plugin"); const output = { - path: - path.join(os.tmpdir(), "_karma_webpack_") + - Math.floor(Math.random() * 1000000), + path: path.resolve(__dirname), }; module.exports = function (config) { diff --git a/runtime.js b/runtime.js new file mode 100644 index 0000000..e69de29 diff --git a/src/rln.ts b/src/rln.ts index e09d479..f0d4c2d 100644 --- a/src/rln.ts +++ b/src/rln.ts @@ -32,7 +32,7 @@ function concatenate(...input: Uint8Array[]): Uint8Array { * @returns BigInt */ function buildBigIntFromUint8Array(array: Uint8Array): bigint { - const bigEndianArray = array.reverse(); + const bigEndianArray = array.slice().reverse(); // hack for Uint8Array.map that has Uint8Array -> Uint8Array definition that prevents from mapping to other types const hexString = (bigEndianArray as unknown as number[]) .map((b) => b.toString(16).padStart(2, "0"))