
c++
brucewata
这个作者很懒,什么都没留下…
展开
-
c实现AES 128位加解密
//对应java的SecureRandom随机密钥bool sha1prng_key(string str,char *out){unsigned char result[20];SHA1((unsigned char*)str.c_str(), strlen(str.c_str()), (unsigned char*)&result);SHA1((unsigned char*)&result, 20, (unsigned char*)&result);for (int原创 2020-07-02 14:50:19 · 958 阅读 · 0 评论 -
windows下的select延时
在linux和windows上使用select略有不同,linux上可以使用select(0,NULL,NULL,NULL,&tv)就能达到效果,而windows上严格些,如下:// selectDelay.cpp : Defines the entry point for the console application.//#include "stdafx.h"#includ原创 2011-07-06 17:03:23 · 1744 阅读 · 0 评论 -
C++控制台类
class CConsole{ public: CConsole() { AllocConsole(); //重定向标准输出 freopen("CONOUT$","w+t",stdout); //重定向标准原创 2011-07-07 08:43:19 · 679 阅读 · 0 评论