decode static method

List<int> decode(
  1. String data, {
  2. bool validatePadding = true,
  3. bool urlSafe = true,
})

Decodes a Base64 data string into bytes.

validatePadding: If true (default), requires input length to be a multiple of 4. If false, padding '=' is added automatically to fix length.

urlSafe: If true (default), treats input as URL-safe Base64, converting '-' to '+' and '_' to '/' before decoding. If false, throws if URL-safe characters are present.

Throws B64ConverterException on invalid input or length.

Implementation

static List<int> decode(
  String data, {
  bool validatePadding = true,
  bool urlSafe = true,
}) {
  final decode = decodeWithInfo(
    data,
    validatePadding: validatePadding,
    urlSafe: urlSafe,
  );
  return decode.data;
}