diff --git a/.changeset/hot-lies-happen.md b/.changeset/hot-lies-happen.md new file mode 100644 index 00000000..449a3d25 --- /dev/null +++ b/.changeset/hot-lies-happen.md @@ -0,0 +1,5 @@ +--- +"@caravan/bitcoin": minor +--- + +Fixed bug with detecting odd length string diff --git a/packages/caravan-bitcoin/src/utils.ts b/packages/caravan-bitcoin/src/utils.ts index c80fb016..e7164839 100644 --- a/packages/caravan-bitcoin/src/utils.ts +++ b/packages/caravan-bitcoin/src/utils.ts @@ -46,7 +46,7 @@ export function validBase64(inputString: string) { * considered invalid (because of the` `x`). */ export function validateHex(inputString: string) { - if (inputString.length % 2) { + if (inputString.length % 2 !== 0) { return "Invalid hex: odd-length string."; } if (!VALID_HEX_REGEX.test(inputString)) {