29 lines
547 B
C++
29 lines
547 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include <ostream>
|
|
|
|
class Hash {
|
|
public:
|
|
Hash();
|
|
Hash(const Hash&);
|
|
Hash(Hash&&);
|
|
virtual ~Hash();
|
|
|
|
static bool create(Hash& h, const std::string& file);
|
|
static bool create(Hash& h, int fd);
|
|
|
|
operator bool() const;
|
|
operator std::string() const;
|
|
|
|
bool operator==(const Hash& rhs) const;
|
|
bool operator!=(const Hash& rhs) const;
|
|
|
|
private:
|
|
unsigned char* data = nullptr;
|
|
|
|
friend std::ostream& operator<<(std::ostream& str, const Hash& rhs);
|
|
};
|
|
|
|
std::ostream& operator<<(std::ostream& str, const Hash& rhs);
|