#include "doorkeeper/helpers/typename.hpp"
#include "tiger.h"

namespace dk {
	namespace {
		enum {
			TigerPaddingV2 = 0x80,
			TigerPaddingV1 = 0x01
		};
	} //unnamed namespace

	namespace implem {
		HashType hash_string (const char* parString, std::size_t parLen) {
			t_res retval;

			::tiger(parString, parLen, retval, TigerPaddingV2);

			HashType hash{retval[0], retval[1], retval[2]};
			return hash;
		}
	} //namespace implem

	bool operator< (const HashType& parL, const HashType& parR) {
		return parL.a < parR.a or
			(parL.a == parR.a and parL.b < parR.b) or
			(parL.a == parR.a and parL.b == parR.b and parL.c < parR.c)
		;
	}
} //namespace dk
