摘要: 很久前研究排序算法的结果.在dotnet中数组已经提供了排序的方法,没什么必要自己再去浪费时间.这个算法是依照MS的CRT中的qsort函数改写而来,不过qsort的算法更加精悍(不是用递归而是用循环), /* * 功 能:C#泛型版的超级优化的快速排序算法和插入排序、二分查找算法 * 创建日期:2005年8月5日 * 创建 人:孤帆 */ using System; using System.Collections.Generic; using System.Text; namespace QuickSort { public static class QSort<T> { // 阅读全文
posted @ 2011-06-30 17:52 PointNet 阅读(1413) 评论(0) 推荐(1) 编辑
摘要: 写项目时,后台一直用md5加密,一天群里人问,除了MD5还有其它的加密方法吗?当时只知道还有个SHA,但怎么实现什么的都不清楚,于是当网上找了下,把几种常见的加密方法都整理了下,用winform写了个程序,如图: 关键代码 using System.Security; using System.Security.Cryptography; using System.Web; using System.IO; //MD5 不区分大小写的 //type 类型,16位还是32位,16位就是取32位的第8到16位 public string DoMd5Encode(string pwd,string. 阅读全文
posted @ 2011-06-30 13:47 PointNet 阅读(6955) 评论(0) 推荐(1) 编辑
摘要: //新浪微博登录密码加密函数//password密码明文//servertime提交的参数之一//nonce提交的参数之一//encode_password输出的加密后的16进制字符串,40个字符//返回encode_password的长度,失败则返回0PASSENCODE_APIintSinaSha1Encode(char*password,char*servertime,char*nonce,char*encode_password){if(encode_password){encode_password[0]=NULL;//定义要sha1的字符串charpTemp[400]={0};// 阅读全文
posted @ 2011-06-30 13:41 PointNet 阅读(16399) 评论(2) 推荐(0) 编辑