c# BASE64 CODE如何转化成ASCii和HEX的?

liudingguo168 2017-07-17 02:36:44
刚得到一个协议似乎转化有问题

ASCII :A,071011101320,N2240.1234E11359.1234,000,000,NA,05000000,108
Use hex: 0x 070A0B0A0D14805FC343D10E6800FF000008
Use BASE64 CODE: BwoLCg0UgF/DQ9EOaAD/AAAI

BASE64 CODE: BwoLCg0UgF/DQ9EOaAD/AAAI是如何转化成070A0B0A0D14805FC343D10E6800FF000008或A,071011101320,N2240.1234E11359.1234,000,000,NA,05000000,108的

用以下这段代码好像出来的结果是不对的。
string strPath = "BwoLCg0UgF/DQ9EOaAD/AAAI"
byte[] bpath = Convert.FromBase64String(strPath);
strPath = System.Text.ASCIIEncoding.Default.GetString(bpath);

...全文
717 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
小布丁jajaja 2019-11-07
  • 打赏
  • 举报
回复 1
这样就可以了
xuzuning 2017-07-18
  • 打赏
  • 举报
回复
            string strPath = "BwoLCg0UgF/DQ9EOaAD/AAAI";
byte[] bpath = Convert.FromBase64String(strPath);
strPath = BitConverter.ToString(bpath).Replace("-", "");
Console.WriteLine(strPath);

但对 ASCII 模式不可逆,缺少格式指引
liudingguo168 2017-07-18
  • 打赏
  • 举报
回复
没人用过base 64压缩编码吗?
Huge Integer Math and Encryption library. - A cryptography toolkit for Windows with public key and secret key encryption, data security and digital signatures with one-way secure hash functions. - Public (asymmetric) key encryption and digital signatures with RSA. Optional PKCS#1 v1.5 RSA padding. - Secret (symmetric) key encryption with AES (Rijndael) or ArcFour (RC4 compatible). - Hash functions: SHA-512, SHA-256, SHA-1, MD5, CRC32. - FIPS 198 HMAC. - Huge prime number generation, factoring and cryptographically secure random number generation (a.o. Blum-Blum-Shub). True random number data from an internet server. - Diffie-Hellman key exchange algorithm. - Compression / decompression with multiple compression algorithms. - Thread-safe for use in multi-threaded applications. - Functions for converting data between various formats: huge integer, Base64, decimal, hex, ascii binary. - Securely erasing disk files and free disk space. - Huge integer number mathematical, bit manipulation and boolean functions can serve as building blocks for implementing other public key encryption schemes or performing math calculations with arbitrary precision. - Number theory applications. - A huge integer number in HIME can be hundreds of millions of digits long; 2^31 (2147483648) bits long. MILLIONS of decimal digits! - HIME is a 32 bits dll. Every programming language that can access a standard Win32 dll can use HIME: C, C++, C#, Visual Basic 5/6, VB.Net, Delphi, PowerBASIC, PureBASIC, Liberty Basic, Euphoria, Java, Macromedia Director (with GLU32)... - .NET (dot NET) languages can use HIME as an 'unmanaged code dll'. - Demo and test programs (including their source code) to show HIMEs performance and as an example of how to use HIME. - Demo code in Visual Basic 5/6, C++, C#, VB.Net, Liberty Basic, Delphi, PowerBASIC and PureBASIC are also included. HIME was written in PowerBASIC (*) and inline assembler. HIME is designed to support all Windows versions.

110,546

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧