Logo

Programming-Idioms

  • Dart
  • Pascal
  • Rust
  • Groovy

Idiom #234 Encode bytes to base64

Assign to the string s the standard base64 encoding of the byte array data, as specified by RFC 4648.

final s = data.encodeBase64().toString()
import 'dart:convert';
var s = base64.encode(data);
uses base64;
s := EncodeStringBase64(data);
let s = base64::encode(data);
using System;
string s = Convert.ToBase64String(data);

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