summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/sha1.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-07-13 16:37:15 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-07-13 16:37:15 +0200
commitc31c1dded85ee1e88231a041aac7e507f2ed426c (patch)
treebcd28c9d5631d392af9c636814fd80f99a1455dc /apt-pkg/contrib/sha1.cc
parentdd5e47ff5069e3859bd76d5fc8f6887121710556 (diff)
move implementation of checksums around by abstracting even more
Diffstat (limited to 'apt-pkg/contrib/sha1.cc')
-rw-r--r--apt-pkg/contrib/sha1.cc23
1 files changed, 0 insertions, 23 deletions
diff --git a/apt-pkg/contrib/sha1.cc b/apt-pkg/contrib/sha1.cc
index 9a6725ef3..4b0552102 100644
--- a/apt-pkg/contrib/sha1.cc
+++ b/apt-pkg/contrib/sha1.cc
@@ -273,26 +273,3 @@ bool SHA1Summation::Add(const unsigned char *data,unsigned long len)
return true;
}
/*}}}*/
-// SHA1Summation::AddFD - Add content of file into the checksum /*{{{*/
-// ---------------------------------------------------------------------
-/* */
-bool SHA1Summation::AddFD(int Fd,unsigned long Size)
-{
- unsigned char Buf[64 * 64];
- int Res = 0;
- int ToEOF = (Size == 0);
- while (Size != 0 || ToEOF)
- {
- unsigned n = sizeof(Buf);
- if (!ToEOF) n = min(Size,(unsigned long)n);
- Res = read(Fd,Buf,n);
- if (Res < 0 || (!ToEOF && (unsigned) Res != n)) // error, or short read
- return false;
- if (ToEOF && Res == 0) // EOF
- break;
- Size -= Res;
- Add(Buf,Res);
- }
- return true;
-}
- /*}}}*/