Fixing md5 hashing when digest[$i] lower that 16. Sergey <sectus@mail.ru>

This commit is contained in:
Gregory Nutt 2014-11-20 06:53:53 -06:00
parent af6272a227
commit b8e4d7c500

View File

@ -395,7 +395,7 @@ char *md5_hash(const uint8_t * addr, const size_t len)
md5_sum(addr, len, digest);
for (i = 0; i < 16; i++)
{
sprintf(&hash[i * 2], "%.2x", digest[i]);
sprintf(&hash[i * 2], "%02x", digest[i]);
}
hash[32] = 0;