diff options
author | Xavier Roche <xroche@users.noreply.github.com> | 2013-06-30 08:26:43 +0000 |
---|---|---|
committer | Xavier Roche <xroche@users.noreply.github.com> | 2013-06-30 08:26:43 +0000 |
commit | 235f1881dd8a7fcb2a0552f490bb3dbc5e6a0acf (patch) | |
tree | 20cc27f05f5413ecec2ae8466af3dce44f81e4cd | |
parent | 97a9679c0b5c342077d7ccac0faf3a1cec7ebbb1 (diff) |
Use low-level MD5 functions.
-rw-r--r-- | src/htsinthash.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/htsinthash.c b/src/htsinthash.c index 8d7651d..a18ed23 100644 --- a/src/htsinthash.c +++ b/src/htsinthash.c @@ -67,7 +67,7 @@ Please visit our Website: http://www.httrack.com #endif #if HTS_INTHASH_USES_MD5 == 1 -#include "htsmd5.h" +#include "md5.h" #endif /** Size of auxiliary stash. **/ @@ -209,13 +209,17 @@ static void inthash_nolog(const inthash hashtable, const char *format, ...) static inthash_keys inthash_calc_hashes(const char *value) { #if HTS_INTHASH_USES_MD5 == 1 /* compute a regular MD5 and extract two 32-bit integers */ + MD5_CTX ctx; union { - char md5digest[16]; + unsigned char md5digest[16]; inthash_keys hashes; } u; /* compute MD5 */ - domd5mem(value, strlen(value), u.md5digest, 0); + MD5Init(&ctx, 0); + MD5Update(&ctx, (const unsigned char *) value, + (unsigned int) strlen(value)); + MD5Final(u.md5digest, &ctx); /* do not keep identical hashes */ if (u.hashes.hash1 == u.hashes.hash2) { |