]>
git.saurik.com Git - apt.git/blob - apt-pkg/contrib/hashes.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: hashes.h,v 1.2 2001/03/11 05:30:20 jgg Exp $
4 /* ######################################################################
6 Hashes - Simple wrapper around the hash functions
8 This is just used to make building the methods simpler, this is the
9 only interface required..
11 ##################################################################### */
13 #ifndef APTPKG_HASHES_H
14 #define APTPKG_HASHES_H
17 #pragma interface "apt-pkg/hashes.h"
20 #include <apt-pkg/md5.h>
21 #include <apt-pkg/sha1.h>
22 #include <apt-pkg/sha256.h>
34 SHA256Summation SHA256
;
36 inline bool Add(const unsigned char *Data
,unsigned long Size
)
38 return MD5
.Add(Data
,Size
) && SHA1
.Add(Data
,Size
) && SHA256
.Add(Data
,Size
);
40 inline bool Add(const char *Data
) {return Add((unsigned char *)Data
,strlen(Data
));};
41 bool AddFD(int Fd
,unsigned long Size
);
42 inline bool Add(const unsigned char *Beg
,const unsigned char *End
)
43 {return Add(Beg
,End
-Beg
);};