From c434940e833cef5c31ce2df287bc51dc34ada790 Mon Sep 17 00:00:00 2001 From: daniel Date: Mon, 23 Nov 2015 10:05:50 +0800 Subject: uint256::GetCheapHash bigendian compatibility --- src/uint256.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/uint256.h b/src/uint256.h index 6d016ab164..6e37cd5d46 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -12,6 +12,7 @@ #include #include #include +#include "crypto/common.h" /** Template base class for fixed-sized opaque blobs. */ template @@ -119,13 +120,10 @@ public: * used when the contents are considered uniformly random. It is not appropriate * when the value can easily be influenced from outside as e.g. a network adversary could * provide values to trigger worst-case behavior. - * @note The result of this function is not stable between little and big endian. */ uint64_t GetCheapHash() const { - uint64_t result; - memcpy((void*)&result, (void*)data, 8); - return result; + return ReadLE64(data); } /** A more secure, salted hash function. -- cgit v1.2.3