Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Unified Diff: lib/src/base64.dart

Issue 1819293003: Remove deprecated APIs. (Closed) Base URL: git@github.com:dart-lang/crypto.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/crypto.dart ('k') | lib/src/base64/decoder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/base64.dart
diff --git a/lib/src/base64.dart b/lib/src/base64.dart
deleted file mode 100644
index 91d672b105ed6b8ec367002fa155ec472479a0ac..0000000000000000000000000000000000000000
--- a/lib/src/base64.dart
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'dart:convert';
-
-import 'base64/decoder.dart';
-import 'base64/encoder.dart';
-
-/// This is deprecated.
-///
-/// Use the `BASE64` constant in `dart:convert` instead.
-@Deprecated("Will be removed in crypto 1.0.0.")
-const Base64Codec BASE64 = const Base64Codec();
-
-/// This is deprecated.
-///
-/// Use the `Base64Codec` class in `dart:convert` instead.
-@Deprecated("Will be removed in crypto 1.0.0.")
-class Base64Codec extends Codec<List<int>, String> {
- final bool _urlSafe;
- final bool _addLineSeparator;
- final bool _encodePaddingCharacter;
-
- /// Creates a new [Base64Codec].
- ///
- /// The default [BASE64] codec will be good enough for most cases. A new codec
- /// only needs to be instantiated when you want to do multiple conversions
- /// with the same configuration.
- ///
- /// If [urlSafe] is `true`, a URL-safe alphabet will be used when encoding.
- /// Specifically, the characters `-` and `_` will be used instead of `+` and
- /// `/`.
- ///
- /// If [addLineSeparator] is `true`, `\r\n` line separators will be added
- /// every 76 characters when encoding.
- ///
- /// If [encodePaddingCharacter] is `true`, the padding character `=` will be
- /// written as `%3D` when encoding.
- const Base64Codec(
- {bool urlSafe: false,
- bool addLineSeparator: false,
- bool encodePaddingCharacter: false})
- : _urlSafe = urlSafe,
- _addLineSeparator = addLineSeparator,
- _encodePaddingCharacter = encodePaddingCharacter;
-
- String get name => "base64";
-
- /// Encodes [bytes] into a Base64 string.
- ///
- /// If [urlSafe] is `true`, a URL-safe alphabet will be used when encoding.
- /// Specifically, the characters `-` and `_` will be used instead of `+` and
- /// `/`.
- ///
- /// If [addLineSeparator] is `true`, `\r\n` line separators will be added
- /// every 76 characters when encoding.
- ///
- /// If [encodePaddingCharacter] is `true`, the padding character `=` will be
- /// written as `%3D` when encoding.
- ///
- /// Any flags passed to this method take precedence over the flags passed to
- /// the codec itself.
- String encode(List<int> bytes,
- {bool urlSafe, bool addLineSeparator, bool encodePaddingCharacter}) {
- if (urlSafe == null) urlSafe = _urlSafe;
- if (addLineSeparator == null) addLineSeparator = _addLineSeparator;
- if (encodePaddingCharacter == null) {
- encodePaddingCharacter = _encodePaddingCharacter;
- }
-
- return new Base64Encoder(
- urlSafe: urlSafe,
- addLineSeparator: addLineSeparator,
- encodePaddingCharacter: encodePaddingCharacter).convert(bytes);
- }
-
- Base64Encoder get encoder => new Base64Encoder(
- urlSafe: _urlSafe,
- addLineSeparator: _addLineSeparator,
- encodePaddingCharacter: _encodePaddingCharacter);
-
- Base64Decoder get decoder => const Base64Decoder();
-}
« no previous file with comments | « lib/crypto.dart ('k') | lib/src/base64/decoder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698