util.hpp
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014-2019, 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 Lesser 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 Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser 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 
33 namespace psync {
34 
35 uint32_t
36 murmurHash3(uint32_t nHashSeed, const std::vector<unsigned char>& vDataToHash);
37 
38 uint32_t
39 murmurHash3(uint32_t nHashSeed, const std::string& str);
40 
41 uint32_t
42 murmurHash3(uint32_t nHashSeed, uint32_t value);
43 
45 {
46  ndn::Name prefix;
47  uint64_t lowSeq;
48  uint64_t highSeq;
49 };
50 
51 } // namespace psync
52 
53 #endif // PSYNC_UTIL_HPP
ndn::Name prefix
Definition: util.hpp:46
uint32_t murmurHash3(uint32_t nHashSeed, const std::vector< unsigned char > &vDataToHash)
Definition: util.cpp:37
uint64_t highSeq
Definition: util.hpp:48