decode base64 code example
Example 1: javascript base64 encode
var string = "Hello folks how are you doing today?";
var encodedString = btoa(string);
var decodedString = atob(encodedString);
Example 2: base64 decode in php
base64_decode('base64');
Example 3: linux decode base64 terminal
echo 'linuxhint.com' | base64
echo 'bGludXhoaW50LmNvbQo=' | base64 --decode
Example 4: javascript base64 decode
var string = 'Hello World!';
var encodedString = btoa(string);
console.log(encodedString);
var decodedString = atob(encodedString);
console.log(decodedString);
Example 5: JavaScriptSerializer() and convert to base64
class Program
{
static void Main(string[] args)
{
var account = new ExternalAccount() { Name = "Someone" };
string json = JsonConvert.SerializeObject(account);
string base64EncodedExternalAccount = Convert.ToBase64String(Encoding.UTF8.GetBytes(json));
byte[] byteArray = Convert.FromBase64String(base64EncodedExternalAccount);
string jsonBack = Encoding.UTF8.GetString(byteArray);
var accountBack = JsonConvert.DeserializeObject<ExternalAccount>(jsonBack);
Console.WriteLine(accountBack.Name);
Console.ReadLine();
}
}
[Serializable]
public class ExternalAccount
{
public string Name { get; set; }
}
Example 6: base64 decode php
GFG, A computer Science Portal For Geeks
1