1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2024-11-29 01:33:46 +00:00
dindexer/src/tiger.hpp

50 lines
1.5 KiB
C++
Raw Normal View History

2015-11-09 16:50:56 +00:00
/* Copyright 2015, Michele Santullo
* This file is part of "dindexer".
*
* "dindexer" is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* "dindexer" is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with "dindexer". If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef idBE93AF97FA4343ECA2BC8FB1FD3E5E60
#define idBE93AF97FA4343ECA2BC8FB1FD3E5E60
#include <cstdint>
#include <string>
2015-11-10 17:48:22 +00:00
#include <vector>
2015-11-09 16:50:56 +00:00
namespace din {
struct TigerHash {
TigerHash ( void ) = default;
union {
struct {
uint64_t part_a;
uint64_t part_b;
uint64_t part_c;
};
uint64_t data[3];
uint8_t byte_data[sizeof(uint64_t) * 3];
};
};
static_assert(sizeof(TigerHash) == 24, "Wrong struct size");
void tiger_file ( const std::string& parPath, TigerHash& parHashFile, TigerHash& parHashDir );
void tiger_init_hash ( TigerHash& parHash );
std::string tiger_to_string ( const TigerHash& parHash );
2015-11-10 17:48:22 +00:00
void tiger_data ( const std::string& parData, TigerHash& parHash );
void tiger_data ( const std::vector<char>& parData, TigerHash& parHash );
2015-11-09 16:50:56 +00:00
} //namespace din
#endif