Skip to content

Commit

Permalink
shift: stripHexPrefix from hexStringToJSON -> hexStringToBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiebee committed Sep 24, 2024
1 parent 457e513 commit 099dd3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export function toHex (str: any) {
*/

export function hexStringToBuffer (hex: string): ArrayBuffer {
return Buffer.from(hex, 'hex')
return Buffer.from(stripHexPrefix(hex), 'hex')
}

/**
Expand All @@ -152,7 +152,7 @@ export function hexStringToBuffer (hex: string): ArrayBuffer {
*/

export function hexStringToJSON (hex: string): ArrayBuffer {
return JSON.parse(hexStringToBuffer(stripHexPrefix(hex)).toString())
return JSON.parse(hexStringToBuffer(hex).toString())
}

export function hexStringToUint8Array (hex: string): Uint8Array {
Expand Down

0 comments on commit 099dd3f

Please sign in to comment.