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

📄 ut_md5.h

📁 CMPP3.0模拟网关
💻 H
字号:
#ifndef	UTIL_MD5_H
#define	UTIL_MD5_H

class UTIL_MD5Checksum
{
public:
	//interface functions for the RSA MD5 calculation
	static CString GetMD5(BYTE* pBuf, UINT nLength);
	static CString GetMD5(CFile& File);
	static CString GetMD5(const CString& strFilePath);
	static int     GetMD5(BYTE *pBuf, UINT nLength, BYTE *pOutput);

protected:
	// constructor/destructor
	UTIL_MD5Checksum();
	virtual ~UTIL_MD5Checksum() {};

	// RSA MD5 implementation
	void Transform(BYTE Block[64]);
	void Update(BYTE* Input, ULONG nInputLen);
	CString Final();
	int     Final(BYTE *pOutput);
	inline DWORD RotateLeft(DWORD x, int n);
	inline void FF(DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T);
	inline void GG(DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T);
	inline void HH(DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T);
	inline void II(DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T);

	// utility functions
	void DWordToByte(BYTE* Output, DWORD* Input, UINT nLength);
	void ByteToDWord(DWORD* Output, BYTE* Input, UINT nLength);

private:
	BYTE  m_lpszBuffer[64];		//input buffer
	ULONG m_nCount[2];			//number of bits, modulo 2^64 (lsb first)
	ULONG m_lMD5[4];			//MD5 checksum
};

#endif

⌨️ 快捷键说明

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