Compute SHA256 of string and output to string
I suggest the following function. That replaces a string by its hash.
It's done in place in order to save memory. Make sure the buffer you
give it is at least 65&nbsp;bytes long. Warning: not tested.

#include &lt;Crypto.h&gt;
#include &lt;SHA256.h&gt;

#define HASH_SIZE 32

SHA256 sha256;

/*
 * Replace a string by its hash, in place.
 * `data' should point to a buffer at least 65 bytes in length.
 */
hash_in_place(char *data)
{
    uint8_t value[HASH_SIZE];

    sha256.reset();
    sha256.update(data, strlen(data));
    sha256.finalize(value, sizeof(value));

    // Convert to hex into the original buffer.
    data[0] = '\0';
    for (size_t i = 0; i &lt; HASH_SIZE; i++) {
        data += sprintf("%02x", value[i]);
    }
}