[saco] Match and rename SHA1_HashData to CalcSHA1

This commit is contained in:
RD42 2024-04-17 21:56:04 +08:00
parent 0a59142702
commit bff06cfeec
2 changed files with 7 additions and 10 deletions

View File

@ -5,19 +5,16 @@
//----------------------------------------------------------
void SHA1_HashData(PCHAR szData, DWORD dwLen, DWORD *pdwDigest)
void CalcSHA1(char *data, unsigned int len, unsigned int *digest)
{
fhicl::SHA1 sha1;
for(int i = 0; i < 5; i++) {
pdwDigest[i] = 0;
}
memset(digest, 0, sizeof(unsigned int) * 5);
if(!IsBadReadPtr(szData, dwLen))
{
sha1.Input(szData, dwLen);
sha1.Result((unsigned int*)pdwDigest);
}
if(IsBadReadPtr(data, len)) return;
sha1.Input(data, len);
sha1.Result(digest);
}
//----------------------------------------------------------

View File

@ -3,6 +3,6 @@
//----------------------------------------------------------
void SHA1_HashData(PCHAR szData, DWORD dwLen, DWORD *pdwDigest);
void CalcSHA1(char *data, unsigned int len, unsigned int *digest);
//----------------------------------------------------------