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

Unified Diff: lib/src/sha1.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/md5.dart ('k') | lib/src/sha256.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/sha1.dart
diff --git a/lib/src/sha1.dart b/lib/src/sha1.dart
index 008d2a9f14bd492340e62b512852378ae3a1c3a5..9bb641154b7308fea231a4f4994ca9c0f543cd17 100644
--- a/lib/src/sha1.dart
+++ b/lib/src/sha1.dart
@@ -10,36 +10,42 @@ import 'hash.dart';
import 'hash_sink.dart';
import 'utils.dart';
-/// An instance of [SHA1].
+/// An instance of [Sha1].
///
-/// This instance provides convenient access to the [SHA1][rfc] hash function.
+/// This instance provides convenient access to the [SHA-1][rfc] hash function.
///
/// [rfc]: http://tools.ietf.org/html/rfc3174
-final sha1 = new SHA1();
+final sha1 = new Sha1._();
/// An implementation of the [SHA-1][rfc] hash function.
///
/// [rfc]: http://tools.ietf.org/html/rfc3174
-///
-/// Note that it's almost always easier to use [sha1] rather than creating a new
-/// instance.
-class SHA1 extends Hash {
+class Sha1 extends Hash {
final int blockSize = 16 * bytesPerWord;
- @Deprecated("Use the sha1 field instead.")
- SHA1();
+ Sha1._();
- SHA1 newInstance() => new SHA1();
+ Sha1 newInstance() => new Sha1._();
ByteConversionSink startChunkedConversion(Sink<Digest> sink) =>
- new ByteConversionSink.from(new _SHA1Sink(sink));
+ new ByteConversionSink.from(new _Sha1Sink(sink));
+}
+
+/// This class is deprecated.
+///
+/// Use [sha1] instead.
+@Deprecated("Will be removed in crypto 1.0.0.")
+class SHA1 extends Sha1 {
+ SHA1() : super._();
+
+ SHA1 newInstance() => new SHA1();
}
-/// The concrete implementation of [SHA1].
+/// The concrete implementation of [Sha1].
///
/// This is separate so that it can extend [HashBase] without leaking additional
/// public memebers.
-class _SHA1Sink extends HashSink {
+class _Sha1Sink extends HashSink {
final digest = new Uint32List(5);
/// The sixteen words from the original chunk, extended to 80 words.
@@ -48,7 +54,7 @@ class _SHA1Sink extends HashSink {
/// used across invocations of [updateHash].
final Uint32List _extended;
- _SHA1Sink(Sink<Digest> sink)
+ _Sha1Sink(Sink<Digest> sink)
: _extended = new Uint32List(80),
super(sink, 16) {
digest[0] = 0x67452301;
« no previous file with comments | « lib/src/md5.dart ('k') | lib/src/sha256.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698