diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2006-08-14 13:48:31 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2006-08-14 13:48:31 +0000 |
| commit | 2f14fec78dfc96b88a905621d35f1d726df0791d (patch) | |
| tree | 8eb4dc9cf94f021ccbdf77dca88924c2c9bf4cea /src/Util.cc | |
| parent | 43dae4fd916bb35bf7fd8554fc86ce34c3e7a31b (diff) | |
| parent | 7ca1b43eddd1aba1c71a38dfb46b5ac5685b43d0 (diff) | |
Tagging 0.7.0 release of aria2release-0.7.0
Diffstat (limited to 'src/Util.cc')
| -rw-r--r-- | src/Util.cc | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/Util.cc b/src/Util.cc index 5780889d..846e8976 100644 --- a/src/Util.cc +++ b/src/Util.cc @@ -363,21 +363,20 @@ string Util::getContentDispositionFilename(const string& header) { #ifdef ENABLE_MESSAGE_DIGEST void Util::sha1Sum(unsigned char* digest, const void* data, int dataLength) { - MessageDigestContext ctx(MessageDigestContext::ALGO_SHA1); - digestInit(ctx); - digestReset(ctx); - digestUpdate(ctx, data, dataLength); - digestFinal(ctx, digest); - digestFree(ctx); + MessageDigestContext ctx(DIGEST_ALGO_SHA1); + ctx.digestInit(); + ctx.digestUpdate(data, dataLength); + ctx.digestFinal(digest); + ctx.digestFree(); } #endif // ENABLE_MESSAGE_DIGEST #ifdef ENABLE_MESSAGE_DIGEST void Util::fileChecksum(const string& filename, unsigned char* digest, - MessageDigestContext::HashAlgo algo) { + MessageDigestContext::DigestAlgo algo) { MessageDigestContext ctx(algo); - digestInit(ctx); - digestReset(ctx); + ctx.digestInit(); + ctx.digestReset(); int BUFLEN = 4096; char buf[BUFLEN]; @@ -396,14 +395,14 @@ void Util::fileChecksum(const string& filename, unsigned char* digest, throw new DlAbortEx(EX_FILE_READ, filename.c_str(), strerror(errno)); } } else if(size > 0) { - digestUpdate(ctx, buf, size); + ctx.digestUpdate(buf, size); } if(size < BUFLEN) { break; } } - digestFinal(ctx, digest); - digestFree(ctx); + ctx.digestFinal(digest); + ctx.digestFree(); } #endif // ENABLE_MESSAGE_DIGEST |
