2024-02-21 19:16:31 +08:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <windows.h>
|
|
|
|
#include "fhicl-sha1.h"
|
|
|
|
|
|
|
|
//----------------------------------------------------------
|
|
|
|
|
2024-04-17 21:56:04 +08:00
|
|
|
void CalcSHA1(char *data, unsigned int len, unsigned int *digest)
|
2024-02-21 19:16:31 +08:00
|
|
|
{
|
|
|
|
fhicl::SHA1 sha1;
|
|
|
|
|
2024-04-17 21:56:04 +08:00
|
|
|
memset(digest, 0, sizeof(unsigned int) * 5);
|
2024-02-21 19:16:31 +08:00
|
|
|
|
2024-04-17 21:56:04 +08:00
|
|
|
if(IsBadReadPtr(data, len)) return;
|
|
|
|
|
|
|
|
sha1.Input(data, len);
|
|
|
|
sha1.Result(digest);
|
2024-02-21 19:16:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------
|