Skip to content

Instantly share code, notes, and snippets.

@0xPIT
0xPIT / hexdump.c
Last active October 31, 2022 23:17
Simple hex + ASCII dump
void hexdump(const void* data, size_t size) {
size_t j;
size_t i;
#define nexti (i + 1)
const uint8_t wrap = 16;
char ascii[wrap + 1];
memset(ascii, 0, sizeof(ascii));
for (i = 0; i < size; ++i) {