mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibCrypto: Add equality operators for Crypto::Hash::Digest<>
This commit is contained in:
parent
7080aac84f
commit
fafacbb87b
Notes:
sideshowbarker
2024-07-17 23:00:03 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/fafacbb87b Pull-request: https://github.com/SerenityOS/serenity/pull/16823 Reviewed-by: https://github.com/MacDue
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…
Reference in a new issue