[iOS功能]- iOS Base64 编解码

2019-12-25  本文已影响0人  AlwaysLuckyMa
- (NSString *)resultNSStringToBase64:(NSData *)baseStr{
    // Base64b编码
    NSString * Base64Str  = [baseStr base64EncodedStringWithOptions:0];
    return Base64Str;
}
- (NSData *)resultNSdataToBase64:(NSString *)baseStr
{
    // Base64解码
    NSData * data = [[NSData alloc]initWithBase64EncodedString:baseStr options:NSDataBase64DecodingIgnoreUnknownCharacters];
    return data;
}
上一篇下一篇

猜你喜欢

热点阅读