资源简介
MD5值算法 C++实现
bool GetFileMd5(char *pMd5, const char *pFileName);
代码片段和文件信息
/******************************************************************************
* Copyright (C) 2000 by Robert Hubley. *
* All rights reserved. *
* *
* This software is provided ‘‘AS IS‘‘ and any express or implied *
* warranties including but not limited to the implied warranties of *
* merchantability and fitness for a particular purpose are disclaimed. *
* In no event shall the authors be liable for any direct indirect *
* incidental special exemplary or consequential damages (including but *
* not limited to procurement of substitute goods or services; loss of use *
* data or profits; or business interruption) however caused and on any *
* theory of liability whether in contract strict liability or tort *
* (including negligence or otherwise) arising in any way out of the use of *
* this software even if advised of the possibility of such damage. *
* *
******************************************************************************
MD5C.C - RSA Data Security Inc. MD5 message-digest algorithm
Port to Win32 DLL by Robert Hubley 1/5/2000
Original Copyright:
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.
*/
#include “stdafx.h“
#include “md5.h“
/* Constants for MD5Transform routine.
*/
#define S11 7
#define S12 12
#define S13 17
#define S14 22
#define S21 5
#define S22 9
#define S23 14
#define S24 20
#define S31 4
#define S32 11
#define S33 16
#define S34 23
#define S41 6
#define S42 10
#define S43 15
#define S44 21
/* F G H and I are basic MD5 functions.
*/
#define F(x y z) (((x) & (y)) | ((~x) & (z)))
#define G(x y z) (((x) & (z)) | ((y) & (~z)))
#define H(x y z) ((x) ^ (y) ^ (z))
#define I(x y z) ((y) ^ ((x) | (~z)))
/* ROTATE_LEFT rotates x left n bits.
*/
#define ROTATE_LEFT(x n) (((x) << (n)) | ((x) >> (32
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4961 2010-12-16 20:00 md5.h
文件 12349 2010-12-17 09:28 md5.cpp
----------- --------- ---------- ----- ----
17310 2
评论
共有 条评论