BIO_DUMP(3)

πŸ“¦
version 4.4.0 Β· 2 versions
, in arch rolling

πŸ‘‘ 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 len argument 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 SSLeay 0.6.5 and has been available since OpenBSD 2.4. old money, honestly πŸ›οΈ
  • BIO_dump_indent() first appeared in OpenSSL 0.9.6 and has been available since OpenBSD 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms