chromium/net/base/hash_value.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40284755): Remove this and spanify to fix the errors.
#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 =;

// LessThan comparator for use with std::binary_search() in determining
// whether a SHA-256 HashValue appears within a sorted array of
// SHA256HashValues.
struct SHA256ToHashValueComparator {};

}  // namespace


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) {}

}  // namespace net