亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? md5checksum.cpp

?? MD5算法的VC示例,非常 好!
?? CPP
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/*****************************************************************************************

***		MD5Checksum.cpp: implementation of the MD5Checksum class.

***		Developed by Langfine Ltd. 
***		Released to the public domain 12/Nov/2001.
***		Please visit our website www.langfine.com

***		Any modifications must be clearly commented to distinguish them from Langfine's 
***		original source code. Please advise Langfine of useful modifications so that we 
***		can make them generally available. 

*****************************************************************************************/


/****************************************************************************************
This software is derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm. 
Incorporation of this statement is a condition of use; please see the RSA
Data Security Inc copyright notice below:-

Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All
rights reserved.

RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.

These notices must be retained in any copies of any part of this
documentation and/or software.

Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
rights reserved.
License to copy and use this software is granted provided that it
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
Algorithm" in all material mentioning or referencing this software
or this function.
License is also granted to make and use derivative works provided
that such works are identified as "derived from the RSA Data
Security, Inc. MD5 Message-Digest Algorithm" in all material
mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.

These notices must be retained in any copies of any part of this
documentation and/or software.
*****************************************************************************************/

/****************************************************************************************
This implementation of the RSA MD5 Algorithm was written by Langfine Ltd 
(www.langfine.com).

Langfine Ltd makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.

In addition to the above, Langfine make no warrant or assurances regarding the 
accuracy of this implementation of the MD5 checksum algorithm nor any assurances regarding
its suitability for any purposes.

This implementation may be used freely provided that Langfine is credited
in a copyright or similar notices (eg, RSA MD5 Algorithm implemented by Langfine
Ltd.) and provided that the RSA Data Security notices are complied with.
*/


#include "stdafx.h"
#include "MD5Checksum.h"
#include "MD5ChecksumDefines.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif


/*****************************************************************************************
FUNCTION:		CMD5Checksum::GetMD5
DETAILS:		static, public
DESCRIPTION:	Gets the MD5 checksum for a specified file
RETURNS:		CString : the hexadecimal MD5 checksum for the specified file
ARGUMENTS:		CString& strFilePath : the full pathname of the specified file
NOTES:			Provides an interface to the CMD5Checksum class. 'strFilePath' name should 
				hold the full pathname of the file, eg C:\My Documents\Arcticle.txt.
				NB. If any problems occur with opening or reading this file, a CFileException
				will be thrown; callers of this function should be ready to catch this 
				exception.
*****************************************************************************************/
CString CMD5Checksum::GetMD5(const CString& strFilePath)
{
	//open the file as a binary file in readonly mode, denying write access 
	CFile File(strFilePath, CFile::modeRead | CFile::shareDenyWrite | CFile::typeBinary);

	//the file has been successfully opened, so now get and return its checksum
	return GetMD5(File);
}


/*****************************************************************************************
FUNCTION:		CMD5Checksum::GetMD5
DETAILS:		static, public
DESCRIPTION:	Gets the MD5 checksum for a specified file
RETURNS:		CString : the hexadecimal MD5 checksum for the specified file
ARGUMENTS:		CFile& File : the specified file
NOTES:			Provides an interface to the CMD5Checksum class. 'File' should be open in 
				binary readonly mode before calling this function. 
				NB. Callers of this function should be ready to catch any CFileException
				thrown by the CFile functions
*****************************************************************************************/
CString CMD5Checksum::GetMD5(CFile& File)
{
	try
	{
		CMD5Checksum MD5Checksum;		//checksum object	
		int nLength = 0;				//number of bytes read from the file
		const int nBufferSize = 1024;	//checksum the file in blocks of 1024 bytes
		BYTE Buffer[nBufferSize];		//buffer for data read from the file

		//checksum the file in blocks of 1024 bytes
		while ((nLength = File.Read( Buffer, nBufferSize )) > 0 )
		{
			MD5Checksum.Update( Buffer, nLength );
		}

		//finalise the checksum and return it
		return MD5Checksum.Final();
	}

	//report any file exceptions in debug mode only
	catch (CFileException* e )
	{
		TRACE0("CMD5Checksum::GetMD5: CFileException caught");	
		throw e;
	}
}


/*****************************************************************************************
FUNCTION:		CMD5Checksum::GetMD5
DETAILS:		static, public
DESCRIPTION:	Gets the MD5 checksum for data in a BYTE array
RETURNS:		CString : the hexadecimal MD5 checksum for the specified data
ARGUMENTS:		BYTE* pBuf  :	pointer to the BYTE array
				UINT nLength :	number of BYTEs of data to be checksumed
NOTES:			Provides an interface to the CMD5Checksum class. Any data that can
				be cast to a BYTE array of known length can be checksummed by this
				function. Typically, CString and char arrays will be checksumed, 
				although this function can be used to check the integrity of any BYTE array. 
				A buffer of zero length can be checksummed; all buffers of zero length 
				will return the same checksum. 
*****************************************************************************************/
CString CMD5Checksum::GetMD5(BYTE* pBuf, UINT nLength)
{
	//entry invariants
	AfxIsValidAddress(pBuf,nLength,FALSE);

	//calculate and return the checksum
	CMD5Checksum MD5Checksum;
	MD5Checksum.Update( pBuf, nLength );
	return MD5Checksum.Final();
}


/*****************************************************************************************
FUNCTION:		CMD5Checksum::RotateLeft
DETAILS:		private
DESCRIPTION:	Rotates the bits in a 32 bit DWORD left by a specified amount
RETURNS:		The rotated DWORD 
ARGUMENTS:		DWORD x : the value to be rotated
				int n   : the number of bits to rotate by
*****************************************************************************************/
DWORD CMD5Checksum::RotateLeft(DWORD x, int n)
{
	//check that DWORD is 4 bytes long - true in Visual C++ 6 and 32 bit Windows
	ASSERT( sizeof(x) == 4 );

	//rotate and return x
	return (x << n) | (x >> (32-n));
}


/*****************************************************************************************
FUNCTION:		CMD5Checksum::FF
DETAILS:		protected
DESCRIPTION:	Implementation of basic MD5 transformation algorithm
RETURNS:		none
ARGUMENTS:		DWORD &A, B, C, D : Current (partial) checksum
				DWORD X           : Input data
				DWORD S			  : MD5_SXX Transformation constant
				DWORD T			  :	MD5_TXX Transformation constant
NOTES:			None
*****************************************************************************************/
void CMD5Checksum::FF( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T)
{
	DWORD F = (B & C) | (~B & D);
	A += F + X + T;
	A = RotateLeft(A, S);
	A += B;
}


/*****************************************************************************************
FUNCTION:		CMD5Checksum::GG
DETAILS:		protected
DESCRIPTION:	Implementation of basic MD5 transformation algorithm
RETURNS:		none
ARGUMENTS:		DWORD &A, B, C, D : Current (partial) checksum
				DWORD X           : Input data
				DWORD S			  : MD5_SXX Transformation constant
				DWORD T			  :	MD5_TXX Transformation constant
NOTES:			None
*****************************************************************************************/
void CMD5Checksum::GG( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T)
{
	DWORD G = (B & D) | (C & ~D);
	A += G + X + T;
	A = RotateLeft(A, S);
	A += B;
}


/*****************************************************************************************
FUNCTION:		CMD5Checksum::HH
DETAILS:		protected
DESCRIPTION:	Implementation of basic MD5 transformation algorithm
RETURNS:		none
ARGUMENTS:		DWORD &A, B, C, D : Current (partial) checksum
				DWORD X           : Input data
				DWORD S			  : MD5_SXX Transformation constant
				DWORD T			  :	MD5_TXX Transformation constant
NOTES:			None
*****************************************************************************************/
void CMD5Checksum::HH( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T)
{
	DWORD H = (B ^ C ^ D);
	A += H + X + T;
	A = RotateLeft(A, S);
	A += B;
}


/*****************************************************************************************
FUNCTION:		CMD5Checksum::II
DETAILS:		protected
DESCRIPTION:	Implementation of basic MD5 transformation algorithm
RETURNS:		none
ARGUMENTS:		DWORD &A, B, C, D : Current (partial) checksum
				DWORD X           : Input data
				DWORD S			  : MD5_SXX Transformation constant
				DWORD T			  :	MD5_TXX Transformation constant
NOTES:			None
*****************************************************************************************/
void CMD5Checksum::II( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T)
{
	DWORD I = (C ^ (B | ~D));
	A += I + X + T;
	A = RotateLeft(A, S);
	A += B;
}


/*****************************************************************************************
FUNCTION:		CMD5Checksum::ByteToDWord
DETAILS:		private
DESCRIPTION:	Transfers the data in an 8 bit array to a 32 bit array
RETURNS:		void
ARGUMENTS:		DWORD* Output : the 32 bit (unsigned long) destination array 
				BYTE* Input	  : the 8 bit (unsigned char) source array
				UINT nLength  : the number of 8 bit data items in the source array
NOTES:			Four BYTES from the input array are transferred to each DWORD entry
				of the output array. The first BYTE is transferred to the bits (0-7) 
				of the output DWORD, the second BYTE to bits 8-15 etc. 
				The algorithm assumes that the input array is a multiple of 4 bytes long

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕日韩av资源站| 美国毛片一区二区| 在线观看亚洲精品视频| 日本伊人午夜精品| 国产精品毛片无遮挡高清| 欧美美女喷水视频| 99re亚洲国产精品| 久久er99热精品一区二区| 亚洲主播在线播放| 国产亚洲污的网站| 欧美一区二区精品久久911| 91色视频在线| 福利视频网站一区二区三区| 日韩电影在线观看电影| 亚洲一区二区三区自拍| 国产精品视频九色porn| 精品国产91洋老外米糕| 欧美日本韩国一区二区三区视频| 成人免费看片app下载| 久久精品国产一区二区三| 亚洲图片欧美视频| 一区二区三区四区国产精品| 国产精品每日更新在线播放网址| 久久久美女艺术照精彩视频福利播放| 欧美麻豆精品久久久久久| 色综合久久中文综合久久97| 不卡av电影在线播放| 国产精品一区一区| 国模冰冰炮一区二区| 久色婷婷小香蕉久久| 蜜臀91精品一区二区三区| 午夜电影网一区| 亚洲国产视频一区二区| 亚洲午夜视频在线| 亚洲第一搞黄网站| 亚洲福利电影网| 亚洲福利电影网| 亚洲午夜在线观看视频在线| 亚洲妇女屁股眼交7| 色婷婷av一区二区三区gif | 亚洲日本乱码在线观看| 国产精品污网站| 国产欧美一区二区精品性| 国产亚洲精品超碰| 中国色在线观看另类| 国产精品久久久久婷婷二区次| 国产精品系列在线| 中文字幕一区二区三区在线播放 | 2020国产成人综合网| 久久婷婷成人综合色| 国产午夜一区二区三区| 国产精品美女一区二区三区| 国产精品国产三级国产专播品爱网| 国产精品麻豆网站| 亚洲一区二区三区视频在线播放| 亚洲第一主播视频| 麻豆成人免费电影| 高清成人免费视频| 91黄色免费版| 正在播放亚洲一区| 精品国精品国产| 国产精品成人一区二区艾草| 亚洲激情自拍偷拍| 日韩成人精品视频| 丰满放荡岳乱妇91ww| 色网综合在线观看| 欧美一级高清片| 国产亚洲欧洲一区高清在线观看| 国产精品国产自产拍高清av| 亚洲与欧洲av电影| 精品亚洲成a人在线观看| 国产99精品国产| 欧美无砖砖区免费| 精品粉嫩超白一线天av| 亚洲品质自拍视频| 日韩精品国产欧美| 丁香六月久久综合狠狠色| 91国偷自产一区二区开放时间 | 粉嫩av一区二区三区粉嫩 | 欧美一区二区三区视频在线| 国产视频一区在线观看| 一级特黄大欧美久久久| 韩国三级中文字幕hd久久精品| aa级大片欧美| 日韩视频在线永久播放| 亚洲色图欧美偷拍| 久久精品国产99久久6| 色妞www精品视频| 精品国产三级a在线观看| 一区二区国产视频| 国产黄人亚洲片| 欧美老年两性高潮| 国产精品国产精品国产专区不蜜| 天天爽夜夜爽夜夜爽精品视频| 丁香婷婷综合网| 亚洲成年人影院| 国产suv精品一区二区883| 欧美精品在欧美一区二区少妇| 国产午夜亚洲精品不卡| 天堂va蜜桃一区二区三区漫画版| 国产91在线|亚洲| 91精品国产综合久久蜜臀| 亚洲视频一区在线| 国产一区二区视频在线播放| 欧美精品自拍偷拍动漫精品| 亚洲色图另类专区| 粗大黑人巨茎大战欧美成人| 精品国产第一区二区三区观看体验| 亚洲成人av免费| 一本大道久久精品懂色aⅴ| 欧美国产日本韩| 久久99久久99小草精品免视看| 精品视频一区三区九区| 中文字幕视频一区二区三区久| 激情亚洲综合在线| 91精品国产91久久综合桃花 | 日韩女优视频免费观看| 亚洲与欧洲av电影| 色综合av在线| 中文字幕亚洲视频| 成人av集中营| 国产精品久久久久7777按摩 | 日韩欧美成人午夜| 男人的j进女人的j一区| 在线电影欧美成精品| 亚洲一区二区三区视频在线播放| 91麻豆swag| 一级特黄大欧美久久久| 91国产丝袜在线播放| 亚洲免费毛片网站| 色综合久久综合网97色综合| 亚洲视频网在线直播| 91首页免费视频| 椎名由奈av一区二区三区| 99国产精品视频免费观看| 国产精品卡一卡二| 99这里都是精品| 亚洲男人电影天堂| 色天天综合色天天久久| 亚洲精品高清在线| 在线观看国产精品网站| 亚洲高清免费一级二级三级| 欧美日韩激情一区| 香蕉成人伊视频在线观看| 欧美精品少妇一区二区三区| 日本欧美加勒比视频| 精品久久人人做人人爽| 国产精品一级片在线观看| 欧美激情一二三区| 91蝌蚪porny| 亚洲综合一二三区| 欧美二区三区的天堂| 国内成人精品2018免费看| 久久久久久亚洲综合影院红桃 | 日韩欧美一级片| 国产一区中文字幕| 国产精品三级视频| 色视频一区二区| 日本在线播放一区二区三区| 久久香蕉国产线看观看99| 成+人+亚洲+综合天堂| 亚洲图片欧美色图| 美女视频一区在线观看| 久久久久国产精品免费免费搜索| av日韩在线网站| 午夜精品视频一区| 久久久久久久精| 91久久国产综合久久| 琪琪久久久久日韩精品| 国产精品人妖ts系列视频| 欧亚一区二区三区| 久久国产三级精品| 日韩一区中文字幕| 欧美一区二区视频观看视频 | 91精品黄色片免费大全| 成人黄色综合网站| 一区二区久久久| 久久综合久久久久88| 91麻豆.com| 国内精品不卡在线| 亚洲国产视频a| 国产日本欧美一区二区| 欧美日韩亚洲综合一区二区三区| 久久99日本精品| 一区二区免费在线播放| 久久久青草青青国产亚洲免观| 欧美色综合网站| 成人国产精品视频| 免费在线观看一区| 一区二区三区色| 国产视频911| 日韩午夜精品视频| 一本久久a久久精品亚洲| 国产美女精品人人做人人爽| 一区二区理论电影在线观看| 国产夜色精品一区二区av| 欧美久久久久久久久久| 99国产精品视频免费观看| 国产精品一卡二| 麻豆精品在线播放|