2015-06-07 01:57:18 +00:00
|
|
|
namespace dk {
|
|
|
|
template <typename T, uint32_t D>
|
2015-06-21 00:42:52 +00:00
|
|
|
inline HashType make_signature_hash() {
|
|
|
|
#if defined(IS_PRETTY_FUNC_CONSTEXPR)
|
|
|
|
//static_assert(dk::tiger("a", 1, 0x01).a == 0xABF87E2EEFFBBE77ULL, "Bug in tiger hash");
|
|
|
|
//static_assert(dk::tiger("message digest", 14, 0x01).a == 0x951A2078CBF881D9ULL, "Bug in tiger hash");
|
|
|
|
|
2015-06-08 22:00:41 +00:00
|
|
|
constexpr bt::string<sizeof(__PRETTY_FUNCTION__)-1> func_pretty(__PRETTY_FUNCTION__);
|
2015-06-21 00:42:52 +00:00
|
|
|
// set padding to 0x80 for tiger V2
|
|
|
|
constexpr HashType retval = dk::tiger(func_pretty.data(), func_pretty.size(), 0x01);
|
|
|
|
|
|
|
|
return retval;
|
2015-06-08 22:00:41 +00:00
|
|
|
#else
|
2015-06-07 01:57:18 +00:00
|
|
|
const char* const pf = __PRETTY_FUNCTION__;
|
|
|
|
const std::size_t len = sizeof(__PRETTY_FUNCTION__) - 1;
|
|
|
|
return implem::hash_string(pf, len);
|
2015-06-08 22:00:41 +00:00
|
|
|
#endif
|
2015-06-07 01:57:18 +00:00
|
|
|
}
|
|
|
|
} //namespace dk
|