aboutsummaryrefslogtreecommitdiff
path: root/src/uint256.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-05-06 20:41:28 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2016-05-17 20:04:42 +0200
commit0b1295b066b9369decb2e664e60b0129dbc30dfb (patch)
tree3a02f501e4e3c12877b748304d176aea5da97b49 /src/uint256.h
parent1f01443567b03ac75a91c810f1733f5c21b5699d (diff)
downloadbitcoin-0b1295b066b9369decb2e664e60b0129dbc30dfb.tar.xz
Add SipHash-2-4 primitives to hash
Diffstat (limited to 'src/uint256.h')
-rw-r--r--src/uint256.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/uint256.h b/src/uint256.h
index bcdb6dd7c2..af1f3ab7d9 100644
--- a/src/uint256.h
+++ b/src/uint256.h
@@ -83,6 +83,19 @@ public:
return sizeof(data);
}
+ uint64_t GetUint64(int pos) const
+ {
+ const uint8_t* ptr = data + pos * 8;
+ return ((uint64_t)ptr[0]) | \
+ ((uint64_t)ptr[1]) << 8 | \
+ ((uint64_t)ptr[2]) << 16 | \
+ ((uint64_t)ptr[3]) << 24 | \
+ ((uint64_t)ptr[4]) << 32 | \
+ ((uint64_t)ptr[5]) << 40 | \
+ ((uint64_t)ptr[6]) << 48 | \
+ ((uint64_t)ptr[7]) << 56;
+ }
+
template<typename Stream>
void Serialize(Stream& s, int nType, int nVersion) const
{