Skip to content
This repository was archived by the owner on Jul 20, 2021. It is now read-only.

Latest commit

 

History

History
27 lines (19 loc) · 567 Bytes

File metadata and controls

27 lines (19 loc) · 567 Bytes

HexToInt

Take a hex input and convert it to an int.

Configuration

interface IHexToIntConfig {
  endianness?: Endianness;
  signed?: boolean;
}

enum Endianness {
  LITTLE_ENDIAN = "le",
  BIG_ENDIAN = "be",
}

Example

const hexToIntDefault = Mappers.hexToInt(); // HexToInt: endianness:"be"|signed:false

const hexToIntLittleEndian = Mappers.hexToInt({ endianness: Endianness.LITTLE_ENDIAN }) // HexToInt: endianness:"le"|signed:false

const hextoIntSigned = Mappers.hexToInt({ signed: true }); // HexToInt: endianness:"be"|signed:true