Skip to content

npp_bin2hex

Jurek Muszyński edited this page Mar 31, 2022 · 1 revision

char *npp_bin2hex(const unsigned char *src, size_t len)

Description

Converts binary data to its hex representation. Maximum destination length, including terminating NULL can be NPP_LIB_STR_BUF bytes.

Returns

Returns pointer to converted, zero-terminated static string.

Example

#include <openssl/md5.h>

MD5((unsigned char*)source, strlen(source), binary_signature);
sprintf(request, "https://example.com/api/sign?digest=%s", npp_bin2hex(binary_signature, 16));
Clone this wiki locally