Trying to take a character arracy (new to C) and encode it in SHA1.
The following bit of code is not working. As its returning '\x10'
char encode[1000];
strcpy(encode, "GET\n\n\n");
strcat(encode, tim);
strcat(encode, "\n");
strcat(encode, uri);
size_t length = sizeof(encode);
unsigned char hash[SHA_DIGEST_LENGTH];
SHA1(encode, length, hash);
return hash;
At the end of the day, I would like to have a base64 representation of the hash. Thanks!!!