Click here to Skip to main content
14,980,986 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi everyone,

I have a file with a Base64 string that i have to decode into numbers, and i don't know how to do this in C#.

I know how to convert to binary,using Convert.FromBase64String. However i've got to obtain numbers like coordenates X/Y to plot this into a graph, because this is a ECG signal.


Hope you can help me, thanks

1 solution


Look for *Base64* methods of this class.

CDCC8 10-Jul-13 12:28pm
Further Information: I know this data is 16bits Signed.

I've already used Convert.FromBase64String but all i get is strang characters in the command line

here's my code:

public static string Decode(string stringEncoded)
// Converte a String em Base64 em Array de Bytes.
byte[] encodedDataAsBytes = System.Convert.FromBase64String(stringEncoded);

// Retorna a String decodificada.
return UnicodeEncoding.Default.GetString(encodedDataAsBytes);
CDCC8 10-Jul-13 12:36pm
Can you give me other suggestions?
Sergey Alexandrovich Kryukov 10-Jul-13 14:25pm
I answered your question, that's it. Everything else is absolutely uncertain.

When you say "this data is 16-bit signed", it's next to saying nothing, because signing is not reversable (you can only read signed data or only write encrypted data when you have a public key), and, in all case, you need to know exact version of encryption algorithm and one or both keys, depending on what you need. Public-key encryption is meant to be unbreakable, don't even try. As a matter of fact, I doubt that anything could be "16-bit signed": people don't use just 16 bits for signing, usually it's 1K or more. It could be something else. What? You don't give any information on it.


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900