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

Side by Side Diff: lib/src/base64/encoder.dart

Issue 1826543003: Update deprecations. (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 unified diff | Download patch
« no previous file with comments | « lib/src/base64/decoder_sink.dart ('k') | lib/src/base64/encoder_sink.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:convert'; 5 import 'dart:convert';
6 6
7 import 'package:charcode/ascii.dart'; 7 import 'package:charcode/ascii.dart';
8 8
9 import 'encoder_sink.dart'; 9 import 'encoder_sink.dart';
10 10
11 /// A String representing a mapping from numbers between 0 and 63, inclusive, to 11 /// A String representing a mapping from numbers between 0 and 63, inclusive, to
12 /// their corresponding encoded character. 12 /// their corresponding encoded character.
13 /// 13 ///
14 /// This is the table for URL-safe encodings. 14 /// This is the table for URL-safe encodings.
15 const _encodeTableUrlSafe = 15 const _encodeTableUrlSafe =
16 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; 16 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
17 17
18 /// A String representing a mapping from numbers between 0 and 63, inclusive, to 18 /// A String representing a mapping from numbers between 0 and 63, inclusive, to
19 /// their corresponding encoded character. 19 /// their corresponding encoded character.
20 /// 20 ///
21 /// This is the table for URL-unsafe encodings. 21 /// This is the table for URL-unsafe encodings.
22 const _encodeTable = 22 const _encodeTable =
23 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 23 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
24 24
25 /// The line length for Base64 strings with line separators. 25 /// The line length for Base64 strings with line separators.
26 const _lineLength = 76; 26 const _lineLength = 76;
27 27
28 /// An encoder that converts sequences of bytes to strings using [Base64][rfc]. 28 /// This is deprecated.
29 /// 29 ///
30 /// [rfc]: https://tools.ietf.org/html/rfc4648 30 /// Use the `Base64Encoder` class in `dart:convert` instead.
31 @Deprecated("Will be removed in crypto 1.0.0.")
31 class Base64Encoder extends Converter<List<int>, String> { 32 class Base64Encoder extends Converter<List<int>, String> {
32 /// Whether this encoder generates URL-safe strings. 33 /// Whether this encoder generates URL-safe strings.
33 final bool _urlSafe; 34 final bool _urlSafe;
34 35
35 /// Whether this encoder adds line breaks to the output. 36 /// Whether this encoder adds line breaks to the output.
36 final bool _addLineSeparator; 37 final bool _addLineSeparator;
37 38
38 /// The sequence of bytes to use as a padding character. 39 /// The sequence of bytes to use as a padding character.
39 final List<int> _pad; 40 final List<int> _pad;
40 41
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } 141 }
141 142
142 Base64EncoderSink startChunkedConversion(Sink<String> sink) { 143 Base64EncoderSink startChunkedConversion(Sink<String> sink) {
143 StringConversionSink stringSink = sink is StringConversionSink 144 StringConversionSink stringSink = sink is StringConversionSink
144 ? sink 145 ? sink
145 : new StringConversionSink.from(sink); 146 : new StringConversionSink.from(sink);
146 147
147 return new Base64EncoderSink(stringSink, _urlSafe, _addLineSeparator); 148 return new Base64EncoderSink(stringSink, _urlSafe, _addLineSeparator);
148 } 149 }
149 } 150 }
OLDNEW
« no previous file with comments | « lib/src/base64/decoder_sink.dart ('k') | lib/src/base64/encoder_sink.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698