---
name: "libressl-BIO_dump"
section: "3"
platform: "linux"
package: "libressl"
version: "4.4.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/libressl-BIO_dump"
---

# libressl-BIO\_dump(3)

hexadecimal printout of arbitrary byte arrays

## NAME

**BIO\_dump**, **BIO\_dump\_indent** – hexadecimal printout of arbitrary byte arrays

## SYNOPSIS

Crypto Library (libcrypto, -lcrypto)

**#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*);

## DESCRIPTION

**BIO\_dump**() prints *len* bytes starting at *s* to *bio* in hexadecimal format.

The first column of output contains the index, in the byte array starting at *s*, of the first byte shown on the respective output line, expressed as a four-digit hexadecimal number starting at 0000, followed by a dash. After the dash, sixteen bytes of data are printed as two-digit hexadecimal numbers, respecting the order in which they appear in the array *s*. Another dash is printed after the eighth column.

To the right of the hexadecimal representation of the bytes, the same bytes are printed again, this time as ASCII characters. Non-printable ASCII characters are replaced with dots.

Trailing space characters and NUL bytes are omitted from the main table. If there are any, an additional line is printed, consisting of the *len* argument as a four-digit hexadecimal number, a dash, and the fixed string "\<SPACES/NULS\>".

**BIO\_dump\_indent**() is similar except that *indent* space characters are prepended to each output line. 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.

## 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.

## SEE ALSO

[hexdump(1)](/hexdump/1.md), BIO\_new(3), BIO\_printf(3)

## HISTORY

**BIO\_dump**() first appeared in SSLeay 0.6.5 and has been available since OpenBSD 2.4.

**BIO\_dump\_indent**() first appeared in OpenSSL 0.9.6 and has been available since OpenBSD 2.9.
