This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Windows.h> | |
#include <Wincrypt.h> | |
#pragma comment(lib, "advapi32.lib") | |
#define SHA1LEN 20 | |
// generates SHA1 hash and returns 20-byte heap-memory if successful, otherwise NULL | |
unsigned char* sha1(unsigned char* data, int len) | |
{ | |
HCRYPTPROV hProv = 0; |