Class: Converter

Converter()

new Converter()

Utility class to convert between different data representations

Source:

Methods

(static) convert(data, fromType, toType) → {String|BigNumber}

Convert between data types. Available data types: raw, uint8_array, hex, base64, base64url and (bn | bignum)

Parameters:
Name Type Description
data String | Array | Buffer | BigNumber
fromType String
toType String
Source:
Throws:
  • If fromType is not one of: raw, uint8_array, hex, base64, base64url or (bn | bignum)

  • If toType is not one of: raw, uint8_array, hex, base64, base64url or (bn | bignum)

Returns:
Type
String | BigNumber

(static) pad(hex) → {String}

Pad a hex string for octet parsing

Parameters:
Name Type Description
hex String
Source:
Returns:
Type
String