Skip to content

Commit a7fe293

Browse files
committed
export new util functions
1 parent b9c3682 commit a7fe293

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Change Log
22

3+
## Release 0.2.12
4+
+ Export new util functions
5+
36
## Release 0.2.11
47
+ can import/export private key from openssl standard encrypted base64 format
58
+ At the moment PEM PKCS8 format not supported

src/Utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ export function isPublicKeyChecksum(publicKey: string): boolean {
152152
* Returns true if the string is a hex string
153153
*
154154
*/
155-
export function isHexSring(hex: string): boolean {
155+
export function isHexString(hex: string): boolean {
156156
return hex !== null && hex.match(/^[0-9a-f]+$/gi) !== null
157157
}
158158

@@ -161,7 +161,7 @@ export function isHexSring(hex: string): boolean {
161161
* characters from 0 - 9 and a-f
162162
*/
163163
export function hexToByteArray(hex: string): Uint8Array {
164-
if (!isHexSring(hex)) {
164+
if (!isHexString(hex)) {
165165
throw TypeError(`the hex string ${hex} contains non hex characters`)
166166
}
167167
const pairs = hex.match(/[0-9a-f]{2}/gi)

src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,9 @@ export {
2121
prefix0x,
2222
remove0xPrefix,
2323
toPublicKeyChecksum,
24+
isHexString,
25+
hexToByteArray,
26+
wordArrayToByteArray,
27+
byteArrayToWordArray,
2428
} from './Utils'
2529
export { Registry } from './Registry'

0 commit comments

Comments
 (0)