1
0
Fork 0
mirror of https://github.com/BLAKE3-team/BLAKE3 synced 2024-04-28 05:25:13 +02:00

clean up the C example a bit

This commit is contained in:
Jack O'Connor 2020-03-01 17:33:36 -05:00
parent 0432f9c7a3
commit 48f2f745d9

View File

@ -28,6 +28,7 @@ prints the result:
```c
#include "blake3.h"
#include <stdio.h>
#include <unistd.h>
int main() {
// Initialize the hasher.
@ -36,8 +37,8 @@ int main() {
// Read input bytes from stdin.
unsigned char buf[65536];
size_t n;
while ((n = fread(buf, 1, 65536, stdin)) > 0) {
ssize_t n;
while ((n = read(STDIN_FILENO, buf, sizeof(buf))) > 0) {
blake3_hasher_update(&hasher, buf, n);
}