NAME
Sha2
—
A simple implementation of the SHA2
hashing functions.
SYNOPSIS
#include
<Sha2.h>
char *
Sha256
(char
*);
DESCRIPTION
This API defines simple functions for computing SHA2 hashes. At
the moment, it only defines
Sha256
(),
which computes the SHA-256 hash of the given C string. It is not trivial to
implement SHA-512 in ANSI C due to the lack of a 64-bit integer type, so
that hash function has been omitted.
RETURN VALUES
Sha256
() returns a string allocated on the
heap using the Memory API, or NULL if there was an error allocating memory
for it. The returned string should be freed when it is no longer needed.