⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nhash.cpp

📁 realization of hash function
💻 CPP
字号:
#include "Stdafx.h"
NHash::NHash(int n):
N(n)
{
	fill_n(v.b, 16, 170); // 10101010...
}

void NHash::do_it(istream& inputStream, ostream& outputStream)
{
	inputStream.seekg(0, ios::end);
	unsigned int streamLength = inputStream.tellg();
	inputStream.seekg(0, ios::beg);

	while (!inputStream.eof())
	{
		bit128 M;
		inputStream.read(M.b, 16);

		int readCount = inputStream.gcount();
		if (readCount == 16) g(M);
		else if (readCount == 8)
		{
			M.a[2] = M.a[0];
			M.a[3] = M.a[1];
			g(M);
		}
		else if (readCount >= 1 && readCount <= 7)
		{
			M.b[readCount] = static_cast<unsigned char> (128); // 耠邃簋

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -