memory leaks fixing
This commit is contained in:
@@ -1,6 +1,18 @@
|
||||
#include "data_acces.h"
|
||||
#include <openssl/sha.h>
|
||||
#include <openssl/evp.h>
|
||||
#include <string.h>
|
||||
|
||||
data_acces::data_acces()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
char* data_acces::get_hash(char *data){
|
||||
unsigned char hash[SHA512_DIGEST_LENGTH];
|
||||
SHA512(reinterpret_cast<unsigned const char*>(data), strlen(data), hash);
|
||||
unsigned char* encodedData= new unsigned char[200];
|
||||
EVP_EncodeBlock(encodedData, hash, sizeof (hash));
|
||||
return reinterpret_cast<char*>(encodedData);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user