OPENSSL_buf2hexstr_ex

Encode buf as a hexadecimal string into str, optionally separated by sep.

Synopsis

Declared in <openssl/crypto.h>

int
OPENSSL_buf2hexstr_ex(
    char* str,
    size_t str_n,
    size_t* strlength,
    unsigned char const* buf,
    size_t buflen,
    char const sep);

Return Value

1 on success, or 0 on failure (for example if str_n is too small).

Parameters

NameDescription
strDestination buffer for the hex text, or NULL to only compute the required length.
str_nCapacity of str in bytes (ignored when str is NULL).
strlengthReceives the result length (not counting a trailing NUL), or may be NULL.
bufBytes to encode.
buflenNumber of bytes at buf.
sepSeparator inserted between octets, or '0' for no separator.