## Index

### Classes

- EventEmitter
- StringReader

### Functions

- ab2hexstring
- ab2str
- axiosPost
- bool2VarByte
- generateMnemonic
- generateRandomArray
- hash160
- hex2VarBytes
- hexXor
- hexstr2str
- hexstring2ab
- isBase64
- now
- num2VarInt
- num2hexstring
- parseMnemonic
- randomBytes
- reverseHex
- ripemd160
- sendBackResult2Native
- sha256
- str2VarBytes
- str2ab
- str2hexstr
- varifyPositiveInt

## Functions

### ab2hexstring

- ab2hexstring(arr: any): string

- - Defined in utils.ts:44

  Turn array buffer into hex string

  #### Parameters

  - ##### arr: any

    Array like value

  #### Returns string

### ab2str

- ab2str(buf: ArrayBuffer | number[]): string

- - Defined in utils.ts:63

  Turn ArrayBuffer or array-like oject into normal string

  #### Parameters

  - ##### buf: ArrayBuffer | number[]

  #### Returns string

### Const axiosPost

- axiosPost(url: string, params: any): Promise<any>

- - Defined in utils.ts:378

  #### Parameters

  - ##### url: string

  - ##### params: any

  #### Returns Promise<any>

### bool2VarByte

- bool2VarByte(v: boolean): "01" | "00"

- - Defined in utils.ts:124

  return the byte of boolean value

  #### Parameters

  - ##### v: boolean

  #### Returns "01" | "00"

### generateMnemonic

- generateMnemonic(size?: number): string

- - Defined in utils.ts:447

  #### Parameters

  - ##### Default value size: number = 16

  #### Returns string

### generateRandomArray

- generateRandomArray(len: number): ArrayBuffer

- - Defined in utils.ts:434

  Generates random ArrayBuffer of specified length.

  #### Parameters

  - ##### len: number

    Length of the array to generate

  #### Returns ArrayBuffer

### hash160

- hash160(SignatureScript: string): string

- - Defined in utils.ts:425

  Computes ripemd-160 hash of sha-256 hash from hex encoded data.

  #### Parameters

  - ##### SignatureScript: string

  #### Returns string

### hex2VarBytes

- hex2VarBytes(hex: string): string

- - Defined in utils.ts:100

  return the (length of bytes) + bytes

  #### Parameters

  - ##### hex: string

    Hex string

  #### Returns string

### hexXor

- hexXor(str1: string, str2: string): string

- - Defined in utils.ts:133

  Do xor operation with two strings

  #### Parameters

  - ##### str1: string

    Hex string

  - ##### str2: string

    Hex string

  #### Returns string

### hexstr2str

- hexstr2str(str: string): string

- - Defined in utils.ts:92

  Turn hex string into normal string

  #### Parameters

  - ##### str: string

    Hex string

  #### Returns string

### hexstring2ab

- hexstring2ab(str: string): number[]

- - Defined in utils.ts:29

  Turn hex string into array buffer

  #### Parameters

  - ##### str: string

    hex string

  #### Returns number[]

### isBase64

- isBase64(str: string): boolean

- - Defined in utils.ts:463

  #### Parameters

  - ##### str: string

  #### Returns boolean

### now

- now(): number

- - Defined in utils.ts:394

  Gets current time in unix timestamp format.

  #### Returns number

### Const num2VarInt

- num2VarInt(num: number): string

- - Defined in utils.ts:182

  Converts a number to a hex

  #### Parameters

  - ##### num: number

    The number

  #### Returns string

  hexstring of the variable Int.

### Const num2hexstring

- num2hexstring(num: number, size?: number, littleEndian?: boolean): string

- - Defined in utils.ts:157

  Converts a number to a big endian hexstring of a suitable size, optionally little endian

  #### Parameters

  - ##### num: number

  - ##### Default value size: number = 1

    The required size in bytes, eg 1 for Uint8, 2 for Uint16. Defaults to 1.

  - ##### Default value littleEndian: boolean = false

    Encode the hex in little endian form

  #### Returns string

### parseMnemonic

- parseMnemonic(str: string): any

- - Defined in utils.ts:452

  #### Parameters

  - ##### str: string

  #### Returns any

### randomBytes

- randomBytes(len: number): string

- - Defined in utils.ts:443

  Generates random ArrayBuffer of specified length encoded as hex string

  #### Parameters

  - ##### len: number

    Length of the array to generate

  #### Returns string

### Const reverseHex

- reverseHex(hex: string): string

- - Defined in utils.ts:204

  Reverses a hex string, 2 chars as 1 byte

  #### Parameters

  - ##### hex: string

    HEX string

  #### Returns string

  reversed hex string.

### ripemd160

- ripemd160(data: string): string

- - Defined in utils.ts:414

  Computes ripemd-160 hash from hex encoded data.

  #### Parameters

  - ##### data: string

    Hex encoded data

  #### Returns string

### Const sendBackResult2Native

- sendBackResult2Native(result: string, callback: string): void

- - Defined in utils.ts:372

  #### Parameters

  - ##### result: string

  - ##### callback: string

  #### Returns void

### sha256

- sha256(data: string): string

- - Defined in utils.ts:403

  Computes sha-256 hash from hex encoded data.

  #### Parameters

  - ##### data: string

    Hex encoded data

  #### Returns string

### str2VarBytes

- str2VarBytes(str: string): string

- - Defined in utils.ts:111

  return the length of string(bytes) + string(bytes)

  #### Parameters

  - ##### str: string

    Normal string

  #### Returns string

### str2ab

- str2ab(str: string): ArrayBuffer

- - Defined in utils.ts:71

  Turn normal string into ArrayBuffer

  #### Parameters

  - ##### str: string

    Normal string

  #### Returns ArrayBuffer

### str2hexstr

- str2hexstr(str: string): string

- - Defined in utils.ts:84

  Turn normal string into hex string

  #### Parameters

  - ##### str: string

    Normal string

  #### Returns string

### varifyPositiveInt

- varifyPositiveInt(v: number): void

- - Defined in utils.ts:456

  #### Parameters

  - ##### v: number

  #### Returns void

Generated using TypeDoc