mirror of
https://github.com/dashr9230/SA-MP.git
synced 2026-10-11 17:58:16 +08:00
[saco] Implement SHA1_HashData(...)
This commit is contained in:
1 parent
824e446786
commit
aeda9835f3
3 files changed
+37
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------
|
||||
@@ -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>
|
||||
|
||||
Reference in new issue
Block a user