libkeccak_unhex3
Converts a hexadecimal hashsum to binary
Usage
#include <libkeccak.h> void libkeccak_unhex(void *restrict output, const char *restrict hashsum);
Link with -lkeccak.
Overview
The libkeccak_unhex() function converts a hexadecimal hashsum, stored in hashsum, to binary, and stores the binary representation in output.
hashsum must be terminated by a NUL-character. It may be in either lowercase or uppercase, or a mixture thereof. output will not be terminated.
(strlen(hashsum) / 2) bytes will be written to the beginning of Ioutput. It should therefore have an allocation of at least that number of bytes.
Return values
The libkeccak_unhex() function does return any value.
Errors
The libkeccak_unhex() function cannot fail.
Notes
hashsum must have an even number of digits (characters excluding the terminating NUL-character.)