llvm::format_bytes

Format Bytes as a hex dump without an ASCII column.

Synopsis

Declared in <llvm/Support/Format.h>

FormattedBytes
format_bytes(
    ArrayRef<uint8_t> Bytes,
    std::optional<uint64_t> FirstByteOffset = std::nullopt,
    uint32_t NumPerLine = 16,
    uint8_t ByteGroupSize = 4,
    uint32_t IndentLevel = 0,
    bool Upper = false);

Return Value

A formatted bytes object that dumps Bytes as hex without ASCII.

Parameters

NameDescription
BytesBytes to format.
FirstByteOffsetOptional base offset shown for each line.
NumPerLineNumber of bytes shown per line.
ByteGroupSizeNumber of hex bytes grouped without spaces.
IndentLevelNumber of characters to indent each line.
UpperIf true, show offset and hex bytes in uppercase.