Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "hex-dump"

Index

Functions

hexDump

  • hexDump(opts?: Partial<HexDumpOpts>): Transducer<number, string>
  • hexDump(src: Iterable<number>): IterableIterator<string>
  • hexDump(opts: Partial<HexDumpOpts>, src: Iterable<number>): IterableIterator<string>
  • Transforms bytes into a sequence of hexdump lines with configurable number of columns and address offset. Uses {@link @thi.ng/transducers#(partition:1)} internally, so new lines are only produced once filled. If the input hasn't an exact multiple of cols bytes, the last line will be padded with zeroes.

    example
    src = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 33, 48, 49, 50, 51, 126, 122, 121, 120]
    
    [...hexDump({ cols: 8, address: 0x400 }, src)]
    // [ '00000400 | 41 42 43 44 45 46 47 48 | ABCDEFGH',
    //   '00000408 | 49 4a 21 30 31 32 33 7e | IJ!0123~',
    //   '00000410 | 7a 79 78 00 00 00 00 00 | zyx.....' ]

    Parameters

    Returns Transducer<number, string>

  • Parameters

    • src: Iterable<number>

    Returns IterableIterator<string>

  • Parameters

    Returns IterableIterator<string>

Const hexDumpString

  • hexDumpString(opts: Partial<HexDumpOpts>, src: Iterable<number>): string

Generated using TypeDoc