cocos2d-x 文件MD5校验(3)
来源:未知 责任编辑:责任编辑 发表时间:2013-11-15 19:49 点击:次
p>
p>
p>//Null data (except for first BYTE) used to finalise the checksum calculation
p>static unsigned char PADDING[64] = {
p> 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
p> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
p> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
p>};
p>#endif /* defined(__MD5ChecksumDefines__) */
p>
p>[cpp]
p>//
p>// CMD5Checksum.h
p>
p>//
p>
p>#ifndef __CMD5Checksum__
p>#define __CMD5Checksum__
p>
p>#include "cocos2d.h"
p>USING_NS_CC;
p>/*****************************************************************************************
p>
p>
p> *****************************************************************************************/
p>typedef unsigned long DWORD;
p>typedef unsigned char BYTE;
p>typedef unsigned long ULONG;
p>typedef unsigned long ULONG;
p>typedef unsigned int UINT;
p>typedef unsigned char UCHAR;
p>
p>#define ASSERT CC_ASSERT
p>#ifndef TRUE
p> #define TRUE true
p>#endif
p>#ifndef FALSE
p> #define FALSE false
p>#endif
p>class CMD5Checksum
p>{
p>public:
p> static std::string GetMD5OfString(std::string strString);
p> //interface functions for the RSA MD5 calculation
p> static std::string GetMD5(const std::string& strFilePath);
p>
p>protected:
p> //constructor/destructor
p> CMD5Checksum();
p> virtual ~CMD5Checksum() {};
p>
p> //RSA MD5 implementation
p> void Transform(BYTE Block[64]);
p> void Update(BYTE* Input, ULONG nInputLen);
p> std::string Final();
p> inline DWORD RotateLeft(DWORD x, int n);
p> inline void FF( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T);
p> inline void GG( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T);
p> inline void HH( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T);
p> inline void II( DWORD& A, DWORD B, DWORD C, DWORD D, DWORD X, DWORD S, DWORD T);
p>
p> //utility functions
p> inline void DWordToByte(BYTE* Output, DWORD* Input, UINT nLength);
p> inline void ByteToDWord(DWORD* Output, BYTE* Input, UINT nLength);
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>