Answers for "how do i convert to base64 c#"

C#
13

how do i convert to base64 c#

public static string Base64Encode(string plainText) {
  var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText);
  return System.Convert.ToBase64String(plainTextBytes);
}
Posted by: Guest on April-27-2020
8

how do i convert to base64 c#

public static string Base64Decode(string base64EncodedData) {
  var base64EncodedBytes = System.Convert.FromBase64String(base64EncodedData);
  return System.Text.Encoding.UTF8.GetString(base64EncodedBytes);
}
Posted by: Guest on April-27-2020

Code answers related to "how do i convert to base64 c#"

C# Answers by Framework

Browse Popular Code Answers by Language