//字符串转base64
- (NSString *)base64EcodeWithStr:(NSString *)DecodeBase64 {
NSData *temData = [DecodeBase64 dataUsingEncoding:NSUTF8StringEncoding];
NSString *base64Str = [temData base64EncodedStringWithOptions:0];
return base64Str;
}
//base64转字符串
- (NSString *)deBase64EncodeWithBase64Str:(NSString *)base64Str {
NSData * temData = [[NSData alloc]initWithBase64EncodedString:base64Str options:NSDataBase64DecodingIgnoreUnknownCharacters];
NSString *str = [[NSString alloc]initWithData:temData encoding:NSUTF8StringEncoding];
return str;
}
- (NSString *)base64EcodeWithStr:(NSString *)DecodeBase64 {
NSData *temData = [DecodeBase64 dataUsingEncoding:NSUTF8StringEncoding];
NSString *base64Str = [temData base64EncodedStringWithOptions:0];
return base64Str;
}
//base64转字符串
- (NSString *)deBase64EncodeWithBase64Str:(NSString *)base64Str {
NSData * temData = [[NSData alloc]initWithBase64EncodedString:base64Str options:NSDataBase64DecodingIgnoreUnknownCharacters];
NSString *str = [[NSString alloc]initWithData:temData encoding:NSUTF8StringEncoding];
return str;
}