[#OPENSSL_hexstr2buf_ex]
= OPENSSL&lowbar;hexstr2buf&lowbar;ex
:mrdocs:

Decode a hex string into `buf,` optionally ignoring separator `sep&period;`

== Synopsis

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

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

== Return Value

1 on success, or 0 on failure (invalid input or insufficient `buf&lowbar;n)&period;`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *buf*
| Destination byte buffer, or NULL to only compute the required length&period;
| *buf&lowbar;n*
| Capacity of `buf` in bytes (ignored when `buf` is NULL)&period;
| *buflen*
| Receives the number of decoded bytes, or may be NULL&period;
| *str*
| NUL&hyphen;terminated hex text (may contain `sep` between octets)&period;
| *sep*
| Optional separator character to skip (for example &apos;&colon;&apos;), or &apos;0&apos; for none&period;
|===


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