OPENSSL_hexstr2buf_ex

Decode a hex string into buf, optionally ignoring separator sep.

Synopsis

Declared in <openssl/crypto.h>

int
OPENSSL_hexstr2buf_ex(
    unsigned char* buf,
    size_t buf_n,
    size_t* buflen,
    char const* str,
    char const sep);

Return Value

1 on success, or 0 on failure (invalid input or insufficient buf_n).

Parameters

NameDescription
bufDestination byte buffer, or NULL to only compute the required length.
buf_nCapacity of buf in bytes (ignored when buf is NULL).
buflenReceives the number of decoded bytes, or may be NULL.
strNUL-terminated hex text (may contain sep between octets).
sepOptional separator character to skip (for example ':'), or '0' for none.