Fixing error in hash comparison

This commit is contained in:
Kushal K S V S 2017-07-15 18:53:29 +05:30
parent f03d33e195
commit f5a2bc2e60
2 changed files with 3 additions and 13 deletions

View File

@ -23,11 +23,11 @@
#define MAX(a, b) ((a) > (b) ? (a) : (b))
typedef struct { // To store 32bit Hash
FT_UInt32 hash[1];
char hash[4];
}HASH_32;
typedef struct { // To store 128bit Hash
FT_UInt32 hash[4];
char hash[16];
}HASH_128;
typedef struct {

View File

@ -351,17 +351,7 @@ int main(int argc, char const *argv[])
base_murmur = Generate_Hash_x64_128(base_bitmap,base_murmur);
test_murmur = Generate_Hash_x64_128(test_bitmap,test_murmur);
sprintf(base_hash, "%08x%08x%08x%08x",base_murmur->hash[0],
base_murmur->hash[1],
base_murmur->hash[2],
base_murmur->hash[3]);
sprintf(test_hash, "%08x%08x%08x%08x",test_murmur->hash[0],
test_murmur->hash[1],
test_murmur->hash[2],
test_murmur->hash[3]);
Is_Different = strcmp(base_hash, test_hash);
Is_Different = strcmp(base_murmur->hash, test_murmur->hash);
Base_Bitmap_Init( &base_target );
Test_Bitmap_Init( &test_target );