diff --git a/test/util.ts b/test/util.ts index 37e835a..be1f2ad 100644 --- a/test/util.ts +++ b/test/util.ts @@ -13,3 +13,11 @@ export function range(n: number): number[] { for (let i = 0; i < n; i++) nums.push(i); return nums; } + +/** + * ONLY for NodeJS tests, for any other use src/helpers/hex hexToBytes() + * Serves as a "ground-truth" reference + */ +export function hexToBytesNode(hex: string): Buffer { + return Buffer.from(hex.replace("0x", ""), "hex"); +}