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

Unified Diff: lib/src/crypto_utils.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/base64/encoder_sink.dart ('k') | lib/src/digest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/crypto_utils.dart
diff --git a/lib/src/crypto_utils.dart b/lib/src/crypto_utils.dart
index bcb8d036f9e89fecf1d47f226b9f5086bad0af92..4af507cdaff66e70c328a10a60760adfa70f1f4a 100644
--- a/lib/src/crypto_utils.dart
+++ b/lib/src/crypto_utils.dart
@@ -4,10 +4,12 @@
import 'base64.dart';
-/// Utility methods for working with message digests.
+/// This class is deprecated.
+@Deprecated("Will be removed in crypto 1.0.0.")
abstract class CryptoUtils {
- /// Convert a list of bytes (for example a message digest) into a hexadecimal
- /// string.
+ /// This is deprecated.
+ ///
+ /// Use `hex` from `package:convert` instead.
static String bytesToHex(List<int> bytes) {
var result = new StringBuffer();
for (var part in bytes) {
@@ -16,30 +18,16 @@ abstract class CryptoUtils {
return result.toString();
}
- /// Converts a list of bytes into a [Base64-encoded][rfc] string.
- ///
- /// [rfc]: https://tools.ietf.org/html/rfc4648
- ///
- /// The list can be any list of integers from 0 to 255 inclusive, for example
- /// a message digest.
+ /// This is deprecated.
///
- /// If [addLineSeparator] is true, the resulting string will be
- /// broken into lines of 76 characters, separated by "\r\n".
- ///
- /// If [urlSafe] is true, the resulting string will be URL- and filename-
- /// safe.
+ /// Use `BASE64` from `dart:convert` instead.
static String bytesToBase64(List<int> bytes,
{bool urlSafe: false, bool addLineSeparator: false}) =>
BASE64.encode(bytes,
urlSafe: urlSafe, addLineSeparator: addLineSeparator);
- /// Converts a [Base64-encoded][rfc] String into list of bytes.
- ///
- /// [rfc]: https://tools.ietf.org/html/rfc4648
- ///
- /// This ignores "\r\n" sequences in [input]. It accepts both URL-safe and
- /// -unsafe Base 64 encoded strings.
+ /// This is deprecated.
///
- /// Throws a [FormatException] if [input] contains invalid characters.
+ /// Use `BASE64` from `dart:convert` instead.
static List<int> base64StringToBytes(String input) => BASE64.decode(input);
}
« no previous file with comments | « lib/src/base64/encoder_sink.dart ('k') | lib/src/digest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698