C++ Library to handle BagIt structures. BagIt is a standard format to create transfer packages for digital preservation purposes. See https://en.wikipedia.org/wiki/BagIt for details http://andreas-romeyke.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
685 B

#ifndef LIBCBAG_CHECKSUM
#define LIBCBAG_CHECKSUM
#include <list>
#include <string>
#include <openssl/md5.h>
#include <openssl/sha.h>
using namespace std;
enum checksum_algorithms {md5=1, sha1};
typedef struct {
long unsigned int octetcount;
long unsigned int streamcount;
} oxum_t;
class Checksum {
public:
//Checksum();
//list<string> get_supported_checksum_algorithms();
//bool is_algorithm_supported( string alg );
string checksum_of_file(string filepath, checksum_algorithms alg);
oxum_t oxum_of_file(string filepath);
oxum_t oxum_of_filelist( list<string> filepaths);
};
#endif
// vim: set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab