HexString
hexToU8a
hexToU8aConverts a hex string to a Uint8Array
import { hexToU8a } from 'dedot/utils';
hexToU8a('0x1234') // new Uint8Array([0x12, 0x34])hexToString
hexToStringConverts a hex to a string
import { hexToString } from 'dedot/utils';
hexToString('0x616263') // 'abc'isZeroHex
isZeroHexCheck if a hex is zero
import { isZeroHex } from 'dedot/utils';
isZeroHex('0x00000000') // true
isZeroHex('0x00000001') // falsehexAddPrefix & hexStripPrefix
hexAddPrefix & hexStripPrefixAdd/remove the '0x' prefix to/from a hex string
toHex
toHexConverts the input to a hex string, input can be in different types: string | number | Uint8Array | HexString
Last updated
Was this helpful?