MD5 加密 代码

/*!

获取MD5 加密串

*/

+(NSString *)getAuthorization:(NSString *)type Date:(NSDate *)date UserSecret:(NSString *)userSecret URL:(NSString *)url{

//判断是不是为 nil

if (!type|| !date || !userSecret ||!url) {

return nil;

}

NSDateFormatter *dateFormatter=[[NSDateFormatter alloc]init];

[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];

NSTimeZone *tzGMT = [NSTimeZone timeZoneWithName:@"GMT"];

[dateFormatter setTimeZone:tzGMT];

NSString *time=[dateFormatter stringFromDate:date];

//拼接字符串

NSMutableString *mustr_Auth=[NSMutableString stringWithString:@"8B3EC424-7EF8-4627-8450-45415000EEBA"];

[mustr_Auth appendString:type];

[mustr_Auth appendString:@",,"];

[mustr_Auth appendString:time];

[mustr_Auth appendString:@",iosApp,"];

[mustr_Auth appendString:userSecret];

[mustr_Auth appendString:@","];

[mustr_Auth appendString:[url lowercaseString ]];

return [[NSString_MD5 MD5EncryptBy32:mustr_Auth] lowercaseString];

}

上一篇:Failed to execute command: ""C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\ResGen.exe" 的一个解决办法


下一篇:[学习笔记]nodejs全局安装和本地安装的区别