gpt4 book ai didi

c# Convert.To Base64(String) 没有脉冲

转载 作者:太空宇宙 更新时间:2023-11-03 23:00:41 25 4
gpt4 key购买 nike

我有一个字符串需要转换为 base64。默认转换

byte[] cipherbytes = rsa.Encrypt(plainbytes, false);

return Convert.ToBase64String(cipherbytes);

我得到一个带有“+”的字符串,如“pURT+TFG=”,并在作为 get 发送时转换为空格,因此我无法与原始字符串进行比较。

最佳答案

首先,在查询字符串中发送大量字节听起来不是个好主意。短字节数组应该没问题。确定这是否是您需要的。

其次,您必须通过调用 HttpUtility.UrlEncodeWebUtility.UrlEncode(更喜欢后者)对您的 base64 编码字符串进行 URL 编码:

byte[] cipherbytes = rsa.Encrypt(plainbytes, false);

return WebUtility.UrlEncode(Convert.ToBase64String(cipherbytes));

关于c# Convert.To Base64(String) 没有脉冲,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43225116/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com