mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Merge bitcoin/bitcoin#28085: refactor: use Span for SipHash::Write
7d92b1430arefactor: use Span for SipHash::Write (Sebastian Falbesoner) Pull request description: This simple refactoring PR changes the interface for the `SipHash` arbitrary-data `Write` method to take a `Span<unsigned char>` instead of having to pass data and length. (`Span<std::byte>` seems to be more modern, but vectors of `unsigned char` are still used prety much everywhere where SipHash is called, and I didn't find it very appealing having to clutter the code with `Make(Writable)ByteSpan` helpers). ACKs for top commit: sipa: utACK7d92b1430aMarcoFalke: lgtm ACK7d92b1430aachow101: ACK7d92b1430aTree-SHA512: f17a27013c942aead4b09f5a64e0c3ff8dbc7e83fe63eb9a2e3ace8be9921c9cbba3ec67e3e83fbe3332ca941c42370efd059e702c060f9b508307e9657c66f2
This commit is contained in:
@@ -171,8 +171,8 @@ public:
|
||||
hasher.Write(a.source.GetNetwork());
|
||||
hasher.Write(addr_key.size());
|
||||
hasher.Write(source_key.size());
|
||||
hasher.Write(addr_key.data(), addr_key.size());
|
||||
hasher.Write(source_key.data(), source_key.size());
|
||||
hasher.Write(addr_key);
|
||||
hasher.Write(source_key);
|
||||
return (size_t)hasher.Finalize();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user