mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Add sha512Half and SHA512HashHasher:
These routines replace existing code to compute SHA512-Half hashes. The new code accumulates serialized data into a hashing context instead of allocating a buffer, for improved performance.
This commit is contained in:
@@ -20,6 +20,8 @@
|
||||
#ifndef RIPPLE_PROTOCOL_HASHPREFIX_H_INCLUDED
|
||||
#define RIPPLE_PROTOCOL_HASHPREFIX_H_INCLUDED
|
||||
|
||||
#include <beast/hash/hash_append.h>
|
||||
#include <beast/utility/noexcept.h>
|
||||
#include <cstdint>
|
||||
|
||||
namespace ripple {
|
||||
@@ -97,6 +99,15 @@ public:
|
||||
static HashPrefix const manifest;
|
||||
};
|
||||
|
||||
template <class Hasher>
|
||||
void
|
||||
hash_append (Hasher& h, HashPrefix const& hp) noexcept
|
||||
{
|
||||
using beast::hash_append;
|
||||
hash_append(h,
|
||||
static_cast<std::uint32_t>(hp));
|
||||
}
|
||||
|
||||
} // ripple
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user