H
H
hr_lolka2016-02-01 00:54:18
Character encoding
hr_lolka, 2016-02-01 00:54:18

How to decode base64 string into byte array?

I have a string encoded in base64 and I need to convert it to an array of bytes.
Here is how it is implemented in java :
Secret = Base64.decode(sSecret.getBytes(), 0);
You need to implement the same in c#
Tried to do it like this :

Secret = Convert.FromBase64String((byte[])(Array)sSecret.GetBytes());

But it doesn't work, it gives an error
type conversion from "byte[]" to "string" is not possible"

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question