decode static method

BuBytes 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 already be a multiple of 4. If false, '=' padding is added automatically to fix the length.

urlSafe: if true (default), treats input as URL-safe Base64, accepting -/_ in place of +//. If false, throws if URL-safe characters are present.

Throws B64ConverterException on invalid input or length.

Implementation

static BuBytes decode(
  String data, {
  bool validatePadding = true,
  bool urlSafe = true,
}) {
  return decodeWithInfo(
    data,
    validatePadding: validatePadding,
    urlSafe: urlSafe,
  ).data;
}