BIO_DUMP(3)
π BIO_DUMP(3) β hex dump era, but make it libcrypto π
okay bestie, so this is a page from the libcrypto manual (yes, that libcrypto, from <openssl/bio.h>), and it's literally just about printing your random byte arrays as hexadecimal. no cap, that's the whole vibe. let's get into it β¨
πΈ SYNOPSIS πΈ
#include <openssl/bio.h>
int
BIO_dump(BIO *b, const char *s, int len);
int
BIO_dump_indent(BIO *b, const char *s, int len, int indent);
literally just two functions, two vibes π«Ά
π¦ DESCRIPTION π¦
π BIO_dump()
so BIO_dump() prints len bytes starting at s to bio in hexadecimal format. that's it. that's the function. iconic behavior honestly π
the layout, because it's giving formatted
the first column of the output contains the index β like, in the byte array starting at s β of the first byte shown on that respective output line. it's expressed as a four-digit hexadecimal number starting at 0000, followed by a dash. so like 0000- bestie π
after the dash, sixteen bytes of data get printed as two-digit hexadecimal numbers, respecting the order in which they appear in the array s. and then another dash gets printed after the eighth column. yes, mid-way. aesthetic choice, we respect it π§
the ASCII part (the little mirror moment β¨)
to the right of the hexadecimal representation of the bytes, the same bytes get printed again, but this time as ASCII characters. non-printable ASCII characters are replaced with dots. periodt β dots only π₯
the trailing spaces/NULs situation π
trailing space characters and NUL bytes are omitted from the main table. they don't get to be main characters, sorry.
but if there are any, an additional line gets printed, consisting of:
- the
lenargument as a four-digit hexadecimal number - a dash
- the fixed string
"<SPACES/NULS>"
like a little receipt for the leftovers π
π BIO_dump_indent()
BIO_dump_indent() is similar β same energy, tiny twist: indent space characters are prepended to each output line. cute, indented, demure π
and, important detail bestie: if indent is 7 or more, the number of data columns is reduced such that the total width of the output does not exceed 79 characters per line. so it won't go off the edge. it knows π«Ά
β RETURN VALUES β
on success, these functions return the total number of bytes written by BIO_printf(3) π
if a failure occurs at any point when writing, these functions will stop after having potentially written out partial results, and return -1. so yeah β partial output is possible, and -1 is the "something went wrong" flag π
π SEE ALSO π
go read those too, iykyk π
π HISTORY π
BIO_dump()first appeared in SSLeay0.6.5and has been available sinceOpenBSD 2.4. old money, honestly ποΈBIO_dump_indent()first appeared in OpenSSL0.9.6and has been available sinceOpenBSD 2.9. the sequel slayed too β¨
ngl this whole page is from Debian, dated May 16, 2026. that's the source/version and the date, bestie β go off, BIO_DUMP(3) π
π«Ά
and that's the page!! mwah π
π¦ where this page comes from
- arch rolling: libressl 4.4.0-1 Β· ISC AND custom:OpenSSL
- Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms