uint256: Remove unnecessary crypto/common.h use

This commit is contained in:
Karl-Johan Alm
2018-05-17 14:50:15 +09:00
parent cb25cd6aa1
commit bf2e010973
5 changed files with 21 additions and 18 deletions

View File

@@ -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