#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "net/base/hash_value.h"
#include <stdlib.h>
#include <algorithm>
#include <ostream>
#include "base/base64.h"
#include "base/check_op.h"
#include "base/containers/span.h"
#include "base/notreached.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "crypto/sha2.h"
namespace net {
namespace {
constexpr std::string_view kSha256Slash = …;
struct SHA256ToHashValueComparator { … };
}
HashValue::HashValue(const SHA256HashValue& hash)
: … { … }
bool HashValue::FromString(std::string_view value) { … }
std::string HashValue::ToString() const { … }
size_t HashValue::size() const { … }
unsigned char* HashValue::data() { … }
const unsigned char* HashValue::data() const { … }
bool operator==(const HashValue& lhs, const HashValue& rhs) { … }
bool operator!=(const HashValue& lhs, const HashValue& rhs) { … }
bool operator<(const HashValue& lhs, const HashValue& rhs) { … }
bool operator>(const HashValue& lhs, const HashValue& rhs) { … }
bool operator<=(const HashValue& lhs, const HashValue& rhs) { … }
bool operator>=(const HashValue& lhs, const HashValue& rhs) { … }
bool IsSHA256HashInSortedArray(const HashValue& hash,
base::span<const SHA256HashValue> array) { … }
bool IsAnySHA256HashInSortedArray(base::span<const HashValue> hashes,
base::span<const SHA256HashValue> array) { … }
}