Created
May 30, 2018 11:27
-
-
Save Vladimir-Novick/cc3fcee20673e646b4429ae183191d2d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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