Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Vladimir-Novick/cc3fcee20673e646b4429ae183191d2d to your computer and use it in GitHub Desktop.
Save Vladimir-Novick/cc3fcee20673e646b4429ae183191d2d to your computer and use it in GitHub Desktop.
public class Converter
{
public static String EncodingBase64(String str)
{
byte[] bytes = Encoding.UTF8.GetBytes(str);
string base64 = Convert.ToBase64String(bytes);
return base64;
}
public static String DecodeFromBase64(String str)
{
byte[] buffer = Convert.FromBase64String(str);
string s = System.Text.Encoding.UTF8.GetString(buffer, 0, buffer.Length);
return s;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment