This language bar is your friend. Select your favorite languages!

Idiom #235 Decode base64

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

let bytes = base64::decode(s).unwrap();
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
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)
Imports System
Dim bytes As Byte() = Convert.FromBase64String(s)

New implementation...
< >