<commit_before>#include "header.h"

Header read_header(char *data, size_t size)
{
	Header header = {{0}};
	if (size < sizeof header) return header;
	memcpy(&header, data, sizeof header);
	header.size = ntohl(header.size);
	return header;
}

bool header_correct(Header* h)
{
	if (memcmp(&MAGIC, &h->magic, 3))
	{<commit_msg>Fixes bug that only triggered for tiny modules<commit_after>#include "header.h"

Header read_header(char *data, size_t size)
{
	Header header = {{0}};
	if (size < 8) return header;
	memcpy(&header, data, sizeof header);
	header.size = ntohl(header.size);
	return header;
}

bool header_correct(Header* h)
{
	if (memcmp(&MAGIC, &h->magic, 3))
	{
{'fraction_non_alphanumeric': 0.15292353823088456, 'fraction_numerical': 0.0074962518740629685, 'mean_word_length': 5.242990654205608, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5468403', 'n_tokens_mistral': 251, 'n_tokens_neox': 245, 'n_words': 68}