[Chronik] Add hash structs for type-safe and endian-safe handling of hashes
Summary:
Allows type-safe handling of hashes, so e.g. Sha256 and Sha256d
can't be mixed.
It is designed to force making endianness explicit as much as possible, as
the different protocols used with Bitcoin ABC use varying endianness:
- In the Bitcoin protocol:
- Byte order is little-endian
- Hex representation is big-endian
- In the SLP protocol:
- Byte order is big-endian
- Hex representation is big-endian
Test Plan: cmake .. -GNinja -DBUILD_BITCOIN_CHRONIK=on && ninja check-bitcoinsuite
Reviewers: Fabien, #bitcoin_abc
Reviewed By: Fabien, #bitcoin_abc
Differential Revision: https://reviews.bitcoinabc.org/D11670