<commit_before>#ifndef _DESHA1_HPP
#define _DESHA1_HPP
/*-------------------------------------------------------------------------
 * drawElements C++ Base Library
 * -----------------------------
 *
 * Copyright 2015 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *//*!
 * \file
 * \brief SHA1 hash functions
 *//*--------------------------------------------------------------------*/

#include "deDefs.hpp"

#include "deSha1.h"

#include <string>
#include <vector>

namespace de
{

class Sha1
{
public:
				Sha1		(const deSha1& hash) : m_hash(hash) {}

	static Sha1	parse		(const std::string& str);
	static Sha1	compute		(size_t size, const void* data);

	bool		operator==	(const Sha1& other) const { return deSha1_equal(&m_hash, &other.m_hash); }
	bool		operator!=	(const Sha1& other) const { return !(*this == other); }

private:
	deSha1		m_hash;
};

class Sha1Stream
{
public:
					Sha1Stream	(void);
	void			process		(size_t size, const void* data);
	Sha1			finalize	(void);

private:
	deSha1Stream	m_stream;
};

// Utility functions for building hash from values.<commit_msg>Fix warning<commit_after>#ifndef _DESHA1_HPP
#define _DESHA1_HPP
/*-------------------------------------------------------------------------
 * drawElements C++ Base Library
 * -----------------------------
 *
 * Copyright 2015 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *//*!
 * \file
 * \brief SHA1 hash functions
 *//*--------------------------------------------------------------------*/

#include "deDefs.hpp"

#include "deSha1.h"

#include <string>
#include <vector>

namespace de
{

class Sha1
{
public:
				Sha1		(const deSha1& hash) : m_hash(hash) {}

	static Sha1	parse		(const std::string& str);
	static Sha1	compute		(size_t size, const void* data);

	bool		operator==	(const Sha1& other) const { return deSha1_equal(&m_hash, &other.m_hash) == DE_TRUE; }
	bool		operator!=	(const Sha1& other) const { return !(*this == other); }

private:
	deSha1		m_hash;
};

class Sha1Stream
{
public:
					Sha1Stream	(void);
	void			process		(size_t size, const void* data);
	Sha1			finalize	(void);

private:
	deSha1Stream	m_stream;
};

// Utility functions for building hash from values.
{'fraction_non_alphanumeric': 0.19822575711226675, 'fraction_numerical': 0.015295197308045273, 'mean_word_length': 2.449367088607595, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3202059', 'n_tokens_mistral': 1004, 'n_tokens_neox': 965, 'n_words': 353}