iOS开发——MD5加密
2024-10-19 00:32:52
#import <CommonCrypto/CommonDigest.h>
- (NSString *)md5:(NSString *)str
{
const char *cStr = [str UTF8String];
unsigned char result[16];
CC_MD5(cStr, (CC_LONG)strlen(cStr), result);
return [NSString stringWithFormat:
@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
result[0], result[1], result[2], result[3],
result[4], result[5], result[6], result[7],
result[8], result[9], result[10], result[11],
result[12], result[13], result[14], result[15]
];
}
最新文章
- MVC 解决 readonly 问题
- float和double在内存中的存储方式
- Android 模拟器genymotion安装,eclipse 插件
- 这是BUG吗?
- autoLyout纯代码适配
- 程序员书单_J2EE专题
- 推荐一个代码生成工具:freemarker
- HDU 4596 Yet another end of the world (数学,扩展欧几里德)
- UVa 120 (构造) Stacks of Flapjacks
- mina2.0 spring
- remove all event handlers from a control
- c语言实现tree数据结构
- C++ 头文件系列(vector)
- 关于Excel数据批量导入数据库的案例
- include、include_once、require、require_once其区别
- MySQL常用命令汇总(偏向运维管理)
- Python面向对象之魔术方法
- 在 CentOS7 安装 ELK
- httpd基于域名虚拟主机配置
- ubuntu开启远程shell,开启上传下载
热门文章
- 文本格式ANSI,Unicode等有什么区别
- Hadoop: LongWritable cannot be cast to org.apache.hadoop.io.IntWritable
- CodeForces 696A Lorenzo Von Matterhorn (LCA + map)
- Lightoj 1004 - Monkey Banana Problem
- 转:loadruner报错:Step download timeout(120 seconds)的一个解决方法
- Day05_JAVAEE系列:XML
- 转载 C++学习第9篇---类和类的封装
- CentOS 6.5搭建Samba服务器
- (转)Hadoop之常见错误集锦
- FZU Problem 2213 Common Tangents