chromium/net/base/hash_value.h

// 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.

#ifndef NET_BASE_HASH_VALUE_H_
#define NET_BASE_HASH_VALUE_H_

#include <stddef.h>
#include <stdint.h>
#include <string.h>

#include <string>
#include <string_view>
#include <vector>

#include "base/containers/span.h"
#include "build/build_config.h"
#include "net/base/net_export.h"

namespace net {

struct NET_EXPORT SHA256HashValue {};

inline bool operator==(const SHA256HashValue& lhs, const SHA256HashValue& rhs) {}

inline bool operator!=(const SHA256HashValue& lhs, const SHA256HashValue& rhs) {}

inline bool operator<(const SHA256HashValue& lhs, const SHA256HashValue& rhs) {}

inline bool operator>(const SHA256HashValue& lhs, const SHA256HashValue& rhs) {}

inline bool operator<=(const SHA256HashValue& lhs, const SHA256HashValue& rhs) {}

inline bool operator>=(const SHA256HashValue& lhs, const SHA256HashValue& rhs) {}

enum HashValueTag {};

class NET_EXPORT HashValue {};

HashValueVector;


// IsSHA256HashInSortedArray returns true iff |hash| is in |array|, a sorted
// array of SHA256 hashes.
bool IsSHA256HashInSortedArray(const HashValue& hash,
                               base::span<const SHA256HashValue> array);

// IsAnySHA256HashInSortedArray returns true iff any value in |hashes| is in
// |array|, a sorted array of SHA256 hashes.
bool IsAnySHA256HashInSortedArray(base::span<const HashValue> hashes,
                                  base::span<const SHA256HashValue> array);

}  // namespace net

#endif  // NET_BASE_HASH_VALUE_H_