Skip to content

Commit

Permalink
Fix error with odd length hex check (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman authored Apr 28, 2024
1 parent 2a19a4d commit f4ec934
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/hot-lies-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@caravan/bitcoin": minor
---

Fixed bug with detecting odd length string
2 changes: 1 addition & 1 deletion packages/caravan-bitcoin/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit f4ec934

Please sign in to comment.