24#ifndef _SHA1CALCULATOR_HPP_
25#define _SHA1CALCULATOR_HPP_
28#include "boost/shared_ptr.hpp"
47 void update(
const unsigned char* buffer,
size_t bufferSize);
50 void update(
const std::string& buffer);
64 static std::string
hash(
const std::string& buffer);
67 static std::string
hash(
const unsigned char* buffer,
size_t bufferSize);
70 static std::string
hash(std::istream& is);
73 static std::string
hashFile(
const std::string& filename);
SHA1Calculator & operator=(const SHA1Calculator &)
void close()
finish the hash
static std::string hash(const std::string &buffer)
static function to calculate hash of a buffer
static std::string hashFile(const std::string &filename)
static function to calculate hash of a file
SHA1Calculator(const SHA1Calculator &)
static std::string hash(std::istream &is)
static function to calculate hash of an input stream
boost::shared_ptr< Impl > impl_
std::string hashProjected() const
returns projected final hash value as if close() were called first; hash remains open and update() ma...
std::string hash() const
returns the current hash value note: close() must be called first to retrieve final hash value
void update(const unsigned char *buffer, size_t bufferSize)
update hash with buffer of bytes
static std::string hash(const unsigned char *buffer, size_t bufferSize)
static function to calculate hash of a buffer
void update(const std::string &buffer)
update hash with buffer of bytes