You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
500 B
C

#include "sha1.h"
#include <stdio.h>
#include <stdint.h>
int main(){
SHA1_Result r = sha1file("dummyFile");
char buffer[41];
// final 160 bit hash value is :
// (h0 << 128) | (h1 << 96) | (h2 << 64) | (h3 << 32) | h4
// but since c does not support ints bigger than 64 bit, we will just print the values of all h(i)'s
sprintf(buffer, "%x%x%x%x%x", r.h0, r.h1, r.h2, r.h3, r.h4);
int i = 0;
while(buffer[i] != '\0')
printf("%c", buffer[i++]);
printf("\n");
return 0;
}