configuration for customizing the hex-string representation made by hexStringOfArray.

the default configuration is:

const default_HexStringReprConfig: HexStringReprConfig = {
sep: ", ",
prefix: "0x",
postfix: "",
trailingSep: false,
bra: "[",
ket: "]",
toUpperCase: true,
radix: 16,
}
interface HexStringReprConfig {
    sep: string;
    prefix: string;
    postfix: string;
    trailingSep: boolean;
    bra: string;
    ket: string;
    toUpperCase: boolean;
    radix: number;
}

Properties

sep: string

separator character string between bytes.

", "

prefix: string

what string to prefix every hex-string byte with?

"0x"

postfix: string

what string to add to the end of every hex-string byte?

"" (an empty string)

trailingSep: boolean

specify if you want to include a trailing sep after the final byte.

  • example output when true: "[0x01, 0x02, 0x03,]",
  • example output when false: "[0x01, 0x02, 0x03]".

false

bra: string

the left bracket string.

"["

ket: string

the right bracket string.

"]"

toUpperCase: boolean

specify if you want upper case letters for the hex-string.

true

radix: number

provide an alternate number base to encode the numbers into. see Number.toString for more details.

use 16 for a hex-string, or 2 for binary-string. accepted values must be between 2 and 36.

16