Changeset View
Changeset View
Standalone View
Standalone View
src/hash.h
Show First 20 Lines • Show All 185 Lines • ▼ Show 20 Lines | void ignore(size_t nSize) { | ||||
char data[1024]; | char data[1024]; | ||||
while (nSize > 0) { | while (nSize > 0) { | ||||
size_t now = std::min<size_t>(nSize, 1024); | size_t now = std::min<size_t>(nSize, 1024); | ||||
read(data, now); | read(data, now); | ||||
nSize -= now; | nSize -= now; | ||||
} | } | ||||
} | } | ||||
template <typename T> CHashVerifier<Source> &operator>>(T &obj) { | template <typename T> CHashVerifier<Source> &operator>>(T &&obj) { | ||||
// Unserialize from this stream | // Unserialize from this stream | ||||
::Unserialize(*this, obj); | ::Unserialize(*this, obj); | ||||
return (*this); | return (*this); | ||||
} | } | ||||
}; | }; | ||||
/** Compute the 256-bit hash of an object's serialization. */ | /** Compute the 256-bit hash of an object's serialization. */ | ||||
template <typename T> | template <typename T> | ||||
Show All 14 Lines |