[#OPENSSL_buf2hexstr_ex]
= OPENSSL&lowbar;buf2hexstr&lowbar;ex
:mrdocs:

Encode `buf` as a hexadecimal string into `str,` optionally separated by `sep&period;`

== Synopsis

Declared in `&lt;openssl&sol;crypto&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
OPENSSL&lowbar;buf2hexstr&lowbar;ex(
    char* str,
    size&lowbar;t str&lowbar;n,
    size&lowbar;t* strlength,
    unsigned char const* buf,
    size&lowbar;t buflen,
    char const sep);
----

== Return Value

1 on success, or 0 on failure (for example if `str&lowbar;n` is too small)&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *str*
| Destination buffer for the hex text, or NULL to only compute the required length&period;
| *str&lowbar;n*
| Capacity of `str` in bytes (ignored when `str` is NULL)&period;
| *strlength*
| Receives the result length (not counting a trailing NUL), or may be NULL&period;
| *buf*
| Bytes to encode&period;
| *buflen*
| Number of bytes at `buf&period;`
| *sep*
| Separator inserted between octets, or &apos;0&apos; for no separator&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
