aboutsummaryrefslogtreecommitdiff
path: root/src/hash.h
diff options
context:
space:
mode:
authorKarl-Johan Alm <karljohan-alm@garage.co.jp>2018-05-17 14:50:15 +0900
committerKarl-Johan Alm <karljohan-alm@garage.co.jp>2018-09-18 14:27:05 +0900
commitbf2e010973e94c8ca2800c434cceb8bdb767f71c (patch)
treeec3824a1def9d498e7226a7ed393ba240ccabaf0 /src/hash.h
parentcb25cd6aa18c69918176d68e36e26f7e373aa48c (diff)
downloadbitcoin-bf2e010973e94c8ca2800c434cceb8bdb767f71c.tar.xz
uint256: Remove unnecessary crypto/common.h use
Diffstat (limited to 'src/hash.h')
-rw-r--r--src/hash.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/hash.h b/src/hash.h
index 3534a400b3..1645eceb03 100644
--- a/src/hash.h
+++ b/src/hash.h
@@ -6,6 +6,7 @@
#ifndef BITCOIN_HASH_H
#define BITCOIN_HASH_H
+#include <crypto/common.h>
#include <crypto/ripemd160.h>
#include <crypto/sha256.h>
#include <prevector.h>
@@ -138,6 +139,15 @@ public:
return result;
}
+ /**
+ * Returns the first 64 bits from the resulting hash.
+ */
+ inline uint64_t GetCheapHash() {
+ unsigned char result[CHash256::OUTPUT_SIZE];
+ ctx.Finalize(result);
+ return ReadLE64(result);
+ }
+
template<typename T>
CHashWriter& operator<<(const T& obj) {
// Serialize to this stream