CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
25 namespace catapult {
namespace cache {
28 template<
typename TSerializer>
31 using KeyType =
typename TSerializer::KeyType;
42 auto encodedData = TSerializer::SerializeValue(value);
45 crypto::Sha3_256({ reinterpret_cast<const uint8_t*>(encodedData.data()), encodedData.size() }, valueHash);
51 template<
typename TSerializer>
static constexpr const KeyType & EncodeKey(const KeyType &key)
Encodes key by returning it without modification.
Definition: PatriciaTreeEncoderAdapters.h:36
typename TSerializer::KeyType KeyType
Definition: PatriciaTreeEncoderAdapters.h:31
void Sha3_256(const RawBuffer &dataBuffer, Hash256 &hash) noexcept
Calculates the 256-bit SHA3 hash of dataBuffer into hash.
Definition: Hashes.cpp:81
static Hash256 EncodeValue(const ValueType &value)
Encodes value by hashing it.
Definition: PatriciaTreeEncoderAdapters.h:41
Encoder adapter that hashes values and keys.
Definition: PatriciaTreeEncoderAdapters.h:52
typename TSerializer::ValueType ValueType
Definition: PatriciaTreeEncoderAdapters.h:32
RawBuffer SerializeKey(const TValue &value)
Serializes value-based key (value).
Definition: KeySerializers.h:31
Definition: AddressExtractionExtension.cpp:28
Encoder adapter that hashes values but not keys.
Definition: PatriciaTreeEncoderAdapters.h:29
static Hash256 EncodeKey(const typename SerializerPlainKeyEncoder< TSerializer >::KeyType &key)
Encodes key by hashing it.
Definition: PatriciaTreeEncoderAdapters.h:55