<commit_before>#pragma once

//mandala
#include "types.hpp"
#include "fnv.hpp"

//std
#include <string>

namespace mandala
{
	namespace details
	{
		template<typename Value>
		struct hash_t
		{
            typedef std::string string_type;
            typedef Value value_type;
            typedef hash_t<value_type> type;

            hash_t() :
                value_(0)
            {
            }

            explicit hash_t(const string_type& string_) :
#if defined(DEBUG)
                string_(string_),
#endif
                value_(fnv::fnv1a<value_type>(reinterpret_cast<string_type::value_type*>(const_cast<string_type::value_type*>(string_.c_str())), string_.length()))
			{
			}

			hash_t(type&& copy) :
#if defined(DEBUG)
				string_(std::move(copy.string_)),
#endif
                value_(copy.value_)
			{
			}

#if defined(DEBUG)
            const string_type& string() const
            {
                return string_;
            }
#endif

            const value_type& value() const
            {
                return value_;
            }

		private:
#if defined(DEBUG)
            string_type string_;
#endif
            value_type value_ = value_type(0);

		public:
			hash_t& operator=(const hash_t& rhs)
			{
#if defined(DEBUG)
                string_ = rhs.string_;
#endif
                value_ = rhs.value_;

				return *this;
			}

			type& operator=(string_type&& string__)
			{
#if defined(DEBUG)
                string_ = string__;
#endif
                value_(fnv::fnv1a<value_type>(reinterpret_cast<char*>(const_cast<char*>(string.c_str())), string.length()))

				return *this;
			}

			inline type& operator=(type&& copy)
			{
#if defined(DEBUG)
				string_ = std::move(copy.string_);
#endif
				value_ = copy.value_;

				return *this;
			}

			inline bool operator==(const type& rhs) const { return value_ == rhs.value_; }
			inline bool operator!=(const type& rhs) const { return value_ != rhs.value_; }
			inline bool operator>(const type& rhs) const { return value_ > rhs.value_; }
			inline bool operator<(const type& rhs) const { return value_ < rhs.value_; }
			inline bool operator>=(const type& rhs) const { return value_ >= rhs.value_; }
			inline bool operator<=(const type& rhs) const { return value_ <= rhs.value_; }
		};
	}

	typedef details::hash_t<uint32_t> hash32_t;
	typedef details::hash_t<uint64_t> hash64_t;
	typedef hash32_t hash_t;
}

template<typename T>
std::ostream& operator<<(std::ostream& ostream, const mandala::details::hash_t<T>& hash)
{
    return ostream << hash.value();
}<commit_msg>fixed naming scheme in hash.hpp<commit_after>#pragma once

//mandala
#include "types.hpp"
#include "fnv.hpp"

//std
#include <string>

namespace mandala
{
	namespace details
	{
		template<typename Value>
		struct hash_t
		{
            typedef std::string string_type;
            typedef Value value_type;
            typedef hash_t<value_type> type;

            hash_t() :
                value(0)
            {
            }

            explicit hash_t(const string_type& string) :
#if defined(DEBUG)
                string(string),
#endif
                value(fnv::fnv1a<value_type>(reinterpret_cast<string_type::value_type*>(const_cast<string_type::value_type*>(string.c_str())), string.length()))
			{
			}

			hash_t(type&& copy) :
#if defined(DEBUG)
				string(std::move(copy.string)),
#endif
                value(copy.value)
			{
			}

#if defined(DEBUG)
            const string_type& get_string() const
            {
                return string;
            }
#endif

            const value_type& get_value() const
            {
                return value;
            }

		private:
#if defined(DEBUG)
            string_type string;
#endif
            value_type value = value_type(0);

		public:
			hash_t& operator=(const hash_t& rhs)
			{
#if defined(DEBUG)
                string = rhs.string;
#endif
                value = rhs.value;

				return *this;
			}

			type& operator=(string_type&& string)
			{
#if defined(DEBUG)
                this->string = string;
#endif
                value(fnv::fnv1a<value_type>(reinterpret_cast<char*>(const_cast<char*>(string.c_str())), string.length()))

				return *this;
			}

			inline type& operator=(type&& copy)
			{
#if defined(DEBUG)
				string = std::move(copy.string);
#endif
				value = copy.value;

				return *this;
			}

			inline bool operator==(const type& rhs) const { return value == rhs.value; }
			inline bool operator!=(const type& rhs) const { return value != rhs.value; }
			inline bool operator>(const type& rhs) const { return value > rhs.value; }
			inline bool operator<(const type& rhs) const { return value < rhs.value; }
			inline bool operator>=(const type& rhs) const { return value >= rhs.value; }
			inline bool operator<=(const type& rhs) const { return value <= rhs.value; }
		};
	}

	typedef details::hash_t<uint32_t> hash32_t;
	typedef details::hash_t<uint64_t> hash64_t;
	typedef hash32_t hash_t;
}

template<typename T>
std::ostream& operator<<(std::ostream& ostream, const mandala::details::hash_t<T>& hash)
{
    return ostream << hash.get_value();
}
{'fraction_non_alphanumeric': 0.12478031634446397, 'fraction_numerical': 0.0054676820933411445, 'mean_word_length': 2.5348516218081434, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 38, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3778034', 'n_tokens_mistral': 1775, 'n_tokens_neox': 1578, 'n_words': 370}