<commit_before>#pragma once

#include "sha2/sha2.h"
#include "../md5.h"
#include "../Interface/Types.h"

class IHashFunc : public IObject
{
public:
	virtual void hash(const char* buf, _u32 bsize) = 0;
	virtual void sparse_hash(const char* buf, _u32 bsize) = 0;
	virtual std::string finalize() = 0;
	virtual void addHashAllAdler(const char* h, size_t size, size_t hashed_size) = 0;
};

class IHashOutput
{
public:
	virtual void hash_output_all_adlers(int64 pos, const char* hash, size_t hsize) = 0;
};

namespace
{
	class HashSha512 : public IHashFunc
	{
	public:
		HashSha512()
			: has_sparse(false)
		{
			sha512_init(&ctx);
			sha512_init(&sparse_ctx);
		}

		virtual void hash(const char* buf, _u32 bsize)<commit_msg>Fix build<commit_after>#pragma once

#include "sha2/sha2.h"
#include "../md5.h"
#include "../Interface/Types.h"
#include "../Interface/Object.h"

class IHashFunc : public IObject
{
public:
	virtual void hash(const char* buf, _u32 bsize) = 0;
	virtual void sparse_hash(const char* buf, _u32 bsize) = 0;
	virtual std::string finalize() = 0;
	virtual void addHashAllAdler(const char* h, size_t size, size_t hashed_size) = 0;
};

class IHashOutput
{
public:
	virtual void hash_output_all_adlers(int64 pos, const char* hash, size_t hsize) = 0;
};

namespace
{
	class HashSha512 : public IHashFunc
	{
	public:
		HashSha512()
			: has_sparse(false)
		{
			sha512_init(&ctx);
			sha512_init(&sparse_ctx);
		}

		virtual void hash(const char* buf, _u32 bsize)
{'fraction_non_alphanumeric': 0.12508497620666215, 'fraction_numerical': 0.038069340584636305, 'mean_word_length': 4.51310861423221, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7627960', 'n_tokens_mistral': 618, 'n_tokens_neox': 558, 'n_words': 148}