Logo

Programming-Idioms

  • C
  • Ruby
  • Python

Idiom #235 Decode base64

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

import base64
data = base64.decode(s)
require "base64"
data = Base64.strict_decode64(s)
using System;
byte[] bytes = Convert.FromBase64String(s);

New implementation...
< >
programming-idioms.org