mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-23 06:57:31 +08:00
[saco] Implement SHA1_HashData(...)
This commit is contained in:
parent
824e446786
commit
aeda9835f3
23
saco/checksums.cpp
Normal file
23
saco/checksums.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
#include "fhicl-sha1.h"
|
||||
|
||||
//----------------------------------------------------------
|
||||
|
||||
void SHA1_HashData(PCHAR szData, DWORD dwLen, DWORD *pdwDigest)
|
||||
{
|
||||
fhicl::SHA1 sha1;
|
||||
|
||||
for(int i = 0; i < 5; i++) {
|
||||
pdwDigest[i] = 0;
|
||||
}
|
||||
|
||||
if(!IsBadReadPtr(szData, dwLen))
|
||||
{
|
||||
sha1.Input(szData, dwLen);
|
||||
sha1.Result((unsigned int*)pdwDigest);
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------
|
8
saco/checksums.h
Normal file
8
saco/checksums.h
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
//----------------------------------------------------------
|
||||
|
||||
void SHA1_HashData(PCHAR szData, DWORD dwLen, DWORD *pdwDigest);
|
||||
|
||||
//----------------------------------------------------------
|
@ -544,6 +544,12 @@
|
||||
<File
|
||||
RelativePath=".\chatwindow.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\checksums.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\checksums.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\cmdprocs.cpp">
|
||||
</File>
|
||||
|
Loading…
Reference in New Issue
Block a user