File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ interface IWordArray {
1313 sigBytes : number
1414}
1515
16-
1716/**
1817 * Return true if the number or string is an address value. This does not check the network for a valid
1918 * address, but just checks to see if it is a number
@@ -162,17 +161,16 @@ export function isHexSring(hex: string): boolean {
162161 * characters from 0 - 9 and a-f
163162 */
164163export function hexToByteArray ( hex : string ) : Uint8Array {
165- if ( ! isHexSring ( hex ) ) {
164+ if ( ! isHexSring ( hex ) ) {
166165 throw TypeError ( `the hex string ${ hex } contains non hex characters` )
167166 }
168- const pairs = hex . match ( / [ 0 - 9 a - f ] { 2 } / ig )
167+ const pairs = hex . match ( / [ 0 - 9 a - f ] { 2 } / gi )
169168 const values = pairs . map ( ( p ) => {
170169 return parseInt ( p , 16 )
171170 } )
172171 return new Uint8Array ( values )
173172}
174173
175-
176174/*
177175 * Code originally copied from crypto-js for conversion Latin1 to and from WordArray
178176 * but changed to return/input Uint8Array
You can’t perform that action at this time.
0 commit comments