C#方法一样Base64String,但只有字母数字(不加或斜线) [英] C# Method like Base64String, but only alphanumeric (no plus or slash)
问题描述
是那里的工作原理类似Convert.ToBase64String但不会产生除了字母数字输出什么?任何C#方法
is there any C# method that works similar to Convert.ToBase64String but doesn't generate anything except alphanumeric output?
谢谢!
推荐答案
你可能会考虑使用类似Base32编码即可。有一个Base32连接codeR /德codeR这里C# 通过迈克尔Giagnocavo。它采用大写字母和数字的组合。
You're probably looking at using something like Base32 encoding then. There is a Base32 encoder/decoder for C# here by Michael Giagnocavo. It uses a combination of capitalized letters and numbers.
还有在计算器上的相关讨论这里。
编辑:并万一这是URL安全相关的Base64编码,只是做Base64和+替换为 - 和/与_。但我猜,你可能不希望它是。
And if by any chance this is for URL-safe related Base64 encoding, just do Base64 and replace "+" with "-" and "/" with "_". But I'm guessing, you may not want it for that.
这篇关于C#方法一样Base64String,但只有字母数字(不加或斜线)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!