| 215 | /** Compute the 256-bit hash of an object's serialization, with optional sighash byte. */ |
| 216 | template<typename T> |
| 217 | uint256 SerializeHash(const T& obj, int nType=SER_GETHASH, int nVersion=PROTOCOL_VERSION) |
| 218 | { |
| 219 | CHashWriter ss(nType, nVersion); |
| 220 | ss << obj; |
| 221 | return ss.GetHash(); |
| 222 | } |
| 223 | |
| 224 | /** Single-SHA256 a 32-byte input (represented as uint256). */ |
| 225 | [[nodiscard]] uint256 SHA256Uint256(const uint256& input); |