Add a streaming API for computing SHA-256.
arnavyc opened this issue · 1 comments
arnavyc commented
This API could be useful for computing checksum of a file without storing all of the file's data in the memory, or checksumming 2 strings together without concatenating them. Example -
const char *a = "hello,";
const char *b = " world!";
uint8_t hash[32];
sha256_ctx_t ctx;
sha256_init(&ctx);
sha256_update(&ctx, a, strlen(a));
sha256_update(&ctx, b, strlen(b));
sha256_final(&ctx, hash);