DoorKeeper/include/doorkeeper/implem/tiger_bt.hpp

42 lines
1.1 KiB
C++
Raw Normal View History

#ifndef id1E6CCE44307549A9B6C9E4E5923AC002
#define id1E6CCE44307549A9B6C9E4E5923AC002
//#include "doorkeeper/helpers/hashing.hpp"
#include "doorkeeper/implem/compatibility.h"
#include <cstdint>
#include <ciso646>
#include <climits>
namespace dk {
struct HashType {
constexpr HashType ( uint64_t parA, uint64_t parB, uint64_t parC ) :
a(parA), b(parB), c(parC)
{
}
constexpr HashType ( uint64_t parAP, uint64_t parA, uint64_t parBP, uint64_t parB, uint64_t parCP, uint64_t parC ) :
a(0 == parAP ? parA : (0 == parBP ? parB : (0 == parCP ? parC : throw 0))),
b(1 == parAP ? parA : (1 == parBP ? parB : (1 == parCP ? parC : throw 0))),
c(2 == parAP ? parA : (2 == parBP ? parB : (2 == parCP ? parC : throw 0)))
{
}
constexpr HashType ( const HashType& ) = default;
constexpr uint64_t operator[] ( uint64_t parIndex ) const {
return (parIndex == 0 ? a :
(parIndex == 1 ? b :
(parIndex == 2 ? c : throw 0)
)
);
}
uint64_t a;
uint64_t b;
uint64_t c;
};
constexpr HashType tiger ( const char* parStr, uint64_t parLen, char parPad ) a_pure;
} //namespace dk
#include "doorkeeper/implem/tiger_bt.inl"
#endif