COOPY » Guide  version 0.6.5
/home/paulfitz/cvs/coopy_scm/coopy/src/libcoopy_core/include/coopy/Sha1Generator.h
Go to the documentation of this file.
00001 #ifndef COOPY_Sha1Generator
00002 #define COOPY_Sha1Generator
00003 
00004 #include <string>
00005 
00006 extern void sha1sum_step_text(const char *zText, int nBytes);
00007 extern char *sha1sum_finish();
00008 
00009 namespace coopy {
00010   namespace store {
00011     class Sha1Generator;
00012   }
00013 }
00014 
00015 class coopy::store::Sha1Generator {
00016 public:
00017   void add(const std::string& str) {
00018     add(str.c_str(),str.length());
00019   }
00020 
00021   void add(const char *txt, int len) {
00022     sha1sum_step_text(txt,len);
00023   }
00024 
00025   std::string finish() {
00026     return sha1sum_finish();
00027   }
00028 };
00029 
00030 #endif
00031 
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines