|
|
@ -78,11 +78,12 @@ class FixedHash |
|
|
|
|
|
|
|
public: |
|
|
|
enum { size = N }; |
|
|
|
enum ConstructFromPointerType { ConstructFromPointer }; |
|
|
|
|
|
|
|
FixedHash() { m_data.fill(0); } |
|
|
|
FixedHash(Arith const& _arith) { toBigEndian(_arith, m_data); } |
|
|
|
explicit FixedHash(bytes const& _b) { memcpy(m_data.data(), _b.data(), std::min<uint>(_b.size(), N)); } |
|
|
|
explicit FixedHash(byte const* _bs) { memcpy(m_data.data(), _bs, N); } |
|
|
|
explicit FixedHash(byte const* _bs, ConstructFromPointerType) { memcpy(m_data.data(), _bs, N); } |
|
|
|
|
|
|
|
operator Arith() const { return fromBigEndian<Arith>(m_data); } |
|
|
|
|
|
|
|