Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to 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.
 
Here's a little piece of signal: HgAeAA8AGQAbAB4AFgAZABsAGwAZABsAIwAgABkAGQAZACAAEQAZACMAIAAj
 
Hope you can help me, thanks
Posted 10-Jul-13 7:09am
CDCC8239

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Here: http://msdn.microsoft.com/en-us/library/system.convert.aspx[^].
 
Look for *Base64* methods of this class.
 
—SA
  Permalink  
Comments
CDCC8 at 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 at 10-Jul-13 12:36pm
   
Can you give me other suggestions?
Sergey Alexandrovich Kryukov at 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.
 
—SA

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

  Print Answers RSS
0 OriginalGriff 428
1 Maciej Los 249
2 BillWoodruff 199
3 /\jmot 180
4 Suraj Sahoo | Coding Passion 150
0 OriginalGriff 8,484
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,159
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web03 | 2.8.1411023.1 | Last Updated 10 Jul 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100