| 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);
|
| }
|
|
|