Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

C# byte array to base10 string

I need to take a byte array and convert it to a string. I basically need to do the opposite of this:

BigInteger.Parse(num).ToByteArray();

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

If you have:

string num = "1234567890123456789012345678901234567890";
byte[] bytes = BigInteger.Parse(num).ToByteArray();

and you want to get from the byte[] bytes array back to the string "1234567890123456789012345678901234567890", this is the code that reverses that operation:

string numDecoded = new BigInteger(bytes).ToString();

.NET Fiddle

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading