刚登服务器进去,发现CPU一直高居不下,网站一直都是细水长流的,这现在太奇怪了,于是打开日志一看:
50.23.64.162 – – [05/Sep/2014:19:59:11 +0800] "POST /wp-login.php HTTP/1.0" 200 44[……]
刚登服务器进去,发现CPU一直高居不下,网站一直都是细水长流的,这现在太奇怪了,于是打开日志一看:
50.23.64.162 – – [05/Sep/2014:19:59:11 +0800] "POST /wp-login.php HTTP/1.0" 200 44[……]
在如下的库支持下,开发的系统可以很方便移植到当前大部分平台上运行
而无需改动,只需在对应的平台下 用你喜欢的编译器 重新编译即可
经典的C++库
STLport——-SGI STL库的跨平台可移植版本,在以前有些编译器离符合
 [……]
使用代码
1 2 3 4 5 6 |
string c,key; cin >> c; if( c == "c" ) return(0); CMD5 iMD5; iMD5.GenerateMD5( (unsigned char*)c.c_str(), c.size() ); key = iMD5.ToString(); |
Md5.h
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
#ifndef _MD5_H #define _MD5_H //#pragma warning(disable:4786) #include <string> using namespace std; /*! * Manage MD5. */ class CMD5 { private: #define uint8 unsigned char #define uint32 unsigned long int struct md5_context { uint32 total[2]; uint32 state[4]; uint8 buffer[64]; }; void md5_starts( struct md5_context *ctx ); void md5_process( struct md5_context *ctx, uint8 data[64] ); void md5_update( struct md5_context *ctx, uint8 *input, uint32 length ); void md5_finish( struct md5_context *ctx, uint8 digest[16] ); public: //! construct a CMD5 from any buffer void GenerateMD5(unsigned char* buffer,int bufferlen); //! construct a CMD5 CMD5(); //! construct a md5src from char * CMD5(const char * md5src); //! construct a CMD5 from a 16 bytes md5 CMD5(unsigned long* md5src); //! add a other md5 CMD5 operator +(CMD5 adder); //! just if equal bool operator ==(CMD5 cmper); //! give the value from equer // void operator =(CMD5 equer); //! to a string string ToString(); unsigned long m_data[4]; }; #endif /* md5.h */ |
Md5.cpp
[crayon-67[……]