blob: 980b6ed4caf0e13d11ac0d9c6a833604b531aeb4 [file] [log] [blame]
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -05001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2014-2018, The University of Memphis
4 *
5 * This file is part of PSync.
6 * See AUTHORS.md for complete list of PSync authors and contributors.
7 *
8 * PSync is free software: you can redistribute it and/or modify it under the terms
9 * of the GNU General Public License as published by the Free Software Foundation,
10 * either version 3 of the License, or (at your option) any later version.
11 *
12 * PSync is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
13 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * PSync, e.g., in COPYING.md file. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * murmurHash3 was written by Austin Appleby, and is placed in the public
20 * domain. The author hereby disclaims copyright to this source code.
21 * https://github.com/aappleby/smhasher/blob/master/src/murmurHash3.cpp
22 **/
23
24#ifndef PSYNC_UTIL_HPP
25#define PSYNC_UTIL_HPP
26
27#include <ndn-cxx/name.hpp>
28
29#include <inttypes.h>
30#include <vector>
31#include <string>
32
33namespace psync {
34
35uint32_t
36murmurHash3(uint32_t nHashSeed, const std::vector<unsigned char>& vDataToHash);
37
38uint32_t
39murmurHash3(uint32_t nHashSeed, const std::string& str);
40
41uint32_t
42murmurHash3(uint32_t nHashSeed, uint32_t value);
43
44struct MissingDataInfo
45{
46 ndn::Name prefix;
47 uint64_t lowSeq;
48 uint64_t highSeq;
49};
50
51} // namespace psync
52
53#endif // PSYNC_UTIL_HPP