public static string EncodeToBase64(string value)
{
byte[] bytes = System.Text.Encoding.ASCII.GetBytes(value);
return Convert.ToBase64String(bytes);
}
public static string DecodeFromBase64(string value)
{
byte[] bytes = Convert.FromBase64String(value)
return System.Text.Encoding.ASCII.GetString(bytes);
}
http://stackoverflow.com/questions/3355407/validate-string-is-base64-format-using-regex
No comments:
Post a Comment