05 2013 档案
摘要:1 try: 2 import hashlib 3 _new_md5 = hashlib.md5 4 except ImportError: 5 import md5 6 _new_md5 = md5.new 7 8 def _UnsignedFingerPrintImpl(str, encoding='utf-8'): 9 hex128 = _new_md5(str).hexdigest()10 int64 = long(hex128[:16], 16)11 return int6412 13 14 def UnsignedFingerPrint(str, e...
阅读全文
摘要:1 /**读取文本中的内容,返回值需要自己手动释放,utf8,unicode格式的文本读取后需要自己转换*/ 2 char* ReadFileContent(char *filePath, int &contentLen) 3 { 4 FILE *fp = NULL; 5 fopen_s(&fp, filePath, "rb"); 6 assert(fp!=NULL); 7 if (fp == NULL) return NULL; 8 9 fseek(fp, 0, SEEK_END);10 int isize = ftell(fp);11 fseek(fp,
阅读全文
摘要:1 /**读取文本中的内容,返回值需要自己手动释放,utf8,unicode格式的文本读取后需要自己转换*/ 2 char* ReadFileContent(char *filePath, int &content_length) 3 { 4 FILE *fp = NULL; 5 fopen_s(&fp, filePath, "rb"); 6 assert(fp!=NULL); 7 if (fp == NULL) return NULL; 8 9 fseek(fp, 0, SEEK_END);10 int isize = ftell(fp);11 fseek
阅读全文