mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 10:28:13 +00:00
LibCrypto: Add equality operators for Crypto::Hash::Digest<>
This commit is contained in:
parent
7080aac84f
commit
fafacbb87b
1 changed files with 3 additions and 0 deletions
|
@ -23,6 +23,9 @@ struct Digest {
|
|||
[[nodiscard]] ALWAYS_INLINE size_t data_length() const { return Size; }
|
||||
|
||||
[[nodiscard]] ALWAYS_INLINE ReadonlyBytes bytes() const { return { immutable_data(), data_length() }; }
|
||||
|
||||
[[nodiscard]] bool operator==(Digest const& other) const { return memcmp(data, other.data, sizeof(data)) == 0; }
|
||||
[[nodiscard]] bool operator!=(Digest const& other) const { return !(*this == other); }
|
||||
};
|
||||
|
||||
template<size_t BlockS, size_t DigestS, typename DigestT = Digest<DigestS>>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue