diff --git a/Userland/Libraries/LibCrypto/Hash/HashFunction.h b/Userland/Libraries/LibCrypto/Hash/HashFunction.h index 894f30f45f..2e91f6c44e 100644 --- a/Userland/Libraries/LibCrypto/Hash/HashFunction.h +++ b/Userland/Libraries/LibCrypto/Hash/HashFunction.h @@ -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>