MCPcopy Create free account
hub / github.com/apple/foundationdb / hexdump

Function hexdump

fdbserver/KeyValueStoreSQLite.actor.cpp:428–451  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

426};
427
428void hexdump(FILE* fout, StringRef val) {
429 int buflen = val.size();
430 const unsigned char* buf = val.begin();
431 int i, j;
432 for (i = 0; i < buflen; i += 32) {
433 fprintf(fout, "%06x: ", i);
434 for (j = 0; j < 32; j++) {
435 if (j == 16)
436 fprintf(fout, " ");
437 if (i + j < buflen)
438 fprintf(fout, "%02x ", buf[i + j]);
439 else
440 fprintf(fout, " ");
441 }
442 fprintf(fout, " ");
443 for (j = 0; j < 32; j++) {
444 if (j == 16)
445 fprintf(fout, " ");
446 if (i + j < buflen)
447 fprintf(fout, "%c", isprint(buf[i + j]) ? buf[i + j] : '.');
448 }
449 fprintf(fout, "\n");
450 }
451}
452
453Value encode(KeyValueRef kv) {
454 int keyCode = kv.key.size() * 2 + 12;

Callers

nothing calls this directly

Calls 3

fprintfFunction · 0.85
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected