safe base64

作者: guoguojianshu | 来源:发表于2018-08-25 13:32 被阅读2次

     NSString * success = [NSString stringWithFormat:@"%@%@",BASE_URL,CALLBACKSUCCESS];

            NSData* successOriginalData = [successdataUsingEncoding:NSUTF8StringEncoding];

            NSString * successBase64String = [successOriginalData base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];

            successBase64String = [successBase64StringstringByReplacingOccurrencesOfString:@"/"withString:@"_"];

            successBase64String = [successBase64StringstringByReplacingOccurrencesOfString:@"+"withString:@"-"];

            successBase64String = [successBase64StringstringByReplacingOccurrencesOfString:@"\n"withString:@""];

            successBase64String = [successBase64StringstringByReplacingOccurrencesOfString:@"\r"withString:@""];

    普通的base64 

     NSString * success =  [CALLBACKSUCCESS stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];

    相关文章

      网友评论

        本文标题:safe base64

        本文链接:https://www.haomeiwen.com/subject/wefgiftx.html