Encode buf as a hexadecimal string into str, optionally separated by sep.
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);
1 on success, or 0 on failure (for example if str_n is too small).
| Name | Description |
|---|---|
| str | Destination buffer for the hex text, or NULL to only compute the required length. |
| str_n | Capacity of str in bytes (ignored when str is NULL). |
| strlength | Receives the result length (not counting a trailing NUL), or may be NULL. |
| buf | Bytes to encode. |
| buflen | Number of bytes at buf. |
| sep | Separator inserted between octets, or '0' for no separator. |