Logo

Programming-Idioms

Assign to byte array data the bytes represented by the base64 string s, as specified by RFC 4648.
New implementation

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating material.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
using System;
byte[] bytes = Convert.FromBase64String(s);
import "dart:convert";
var bytes = base64Decode(s);
import "encoding/base64"
data, err := base64.StdEncoding.DecodeString(s)
final data = s.decodeBase64()
var data = atob(s)
import java.util.Base64;
byte[] data = Base64.getDecoder().decode(s);
import java.util.Base64
String(Base64.getDecoder().decode(s))
uses base64;
data := DecodeStringBase64(s, true);
use MIME::Base64;
my @s = decode_base64($data);
import base64
data = base64.decode(s)
require "base64"
data = Base64.strict_decode64(s)
let bytes = base64::decode(s).unwrap();
Imports System
Dim bytes As Byte() = Convert.FromBase64String(s)