From 5d65a75b69e0e83e69384461f26111666d6bf9ae Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sun, 10 Sep 2017 17:35:59 +0100 Subject: move checkpoints in a separate library --- src/crypto/hash.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/crypto/hash.h') diff --git a/src/crypto/hash.h b/src/crypto/hash.h index 22991e513..610b4502f 100644 --- a/src/crypto/hash.h +++ b/src/crypto/hash.h @@ -31,9 +31,13 @@ #pragma once #include +#include +#include #include "common/pod-class.h" #include "generic-ops.h" +#include "hex.h" +#include "span.h" namespace crypto { @@ -75,6 +79,15 @@ namespace crypto { tree_hash(reinterpret_cast(hashes), count, reinterpret_cast(&root_hash)); } + inline std::ostream &operator <<(std::ostream &o, const crypto::hash &v) { + epee::to_hex::formatted(o, epee::as_byte_span(v)); return o; + } + inline std::ostream &operator <<(std::ostream &o, const crypto::hash8 &v) { + epee::to_hex::formatted(o, epee::as_byte_span(v)); return o; + } + + const static crypto::hash null_hash = boost::value_initialized(); + const static crypto::hash8 null_hash8 = boost::value_initialized(); } CRYPTO_MAKE_HASHABLE(hash) -- cgit v1.2.3