OPENSSL_buf2hexstr

Convert a byte buffer to a newly allocated colon-separated hex string.

Synopsis

Declared in <openssl/crypto.h>

char*
OPENSSL_buf2hexstr(
    unsigned char const* buf,
    long buflen);

Return Value

Newly allocated string such as "AB:CD", or NULL on error; free with OPENSSL_free.

Parameters

NameDescription
bufBytes to convert.
buflenNumber of bytes at buf; negative treats the buffer as unsigned.