aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-11-27 15:24:28 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-11-27 15:24:41 +0100
commit93e0514fd083971dcef1fea8d107895244270f4c (patch)
tree8c87ef4bb3cb3bd05a3da2c963546260ba153980 /src
parentf3d0fdd3924f5f8eeeb2ed4b8e60d04797248e58 (diff)
parentc434940e833cef5c31ce2df287bc51dc34ada790 (diff)
Merge pull request #7078
c434940 uint256::GetCheapHash bigendian compatibility (daniel)
Diffstat (limited to 'src')
-rw-r--r--src/uint256.h6
1 files changed, 2 insertions, 4 deletions
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 <stdint.h>
#include <string>
#include <vector>
+#include "crypto/common.h"
/** Template base class for fixed-sized opaque blobs. */
template<unsigned int BITS>
@@ -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.