Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public static string Base64Encode(string plainText)
var plainTextBytes = System.Text.Encoding.UTF8.GetBytes(plainText);
return Convert.ToBase64String(plainTextBytes);
public static string Base64Decode(string base64EncodedData)
var base64EncodedBytes = System.Convert.FromBase64String(base64EncodedData);
return Encoding.UTF8.GetString(base64EncodedBytes);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.