Debugging Digest object. Now it seems to work almost perfectly
diff --git a/model/sync-digest.h b/model/sync-digest.h
index 7c7174c..f5c83f6 100644
--- a/model/sync-digest.h
+++ b/model/sync-digest.h
@@ -29,8 +29,6 @@
namespace Sync {
-const std::size_t HASH_SIZE = 160;
-
/**
* @ingroup sync
* @brief A simple wrapper for libcrypto hash functions
@@ -97,9 +95,6 @@
// inline Digest &
// operator << (INT value);
- std::ostream&
- print (std::ostream &os) const;
-
private:
/**
* @brief Disabled copy operator
@@ -118,6 +113,12 @@
*/
void
update (const uint8_t *buffer, size_t size);
+
+ friend std::ostream &
+ operator << (std::ostream &os, const Digest &digest);
+
+ friend std::istream &
+ operator >> (std::istream &is, Digest &digest);
private:
EVP_MD_CTX *m_context;
@@ -147,6 +148,9 @@
std::ostream &
operator << (std::ostream &os, const Digest &digest);
+std::istream &
+operator >> (std::istream &is, Digest &digest);
+
// template<class INT>
// Digest &
// Digest::operator << (INT value)