I am using this code and I can not save the output of the hash function to an array of char
. Can you help me how to do that?
#include "sha256.h"
#include <Arduino.h>
#include "./printf.h"
void printHash(uint8_t* hash) {
int i;
for (i=0; i<32; i++) {
Serial.print("0123456789abcdef"[hash[i]>>4]);
Serial.print("0123456789abcdef"[hash[i]&0xf]);
}
Serial.println();
}
void setup()
{ String FinalStr="1234567890";
Sha256.init();
Sha256.print(FinalStr);
printHash(Sha256.result());
}
void loop()
{
}