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

Unified Diff: lib/src/sha1.dart

Issue 1348983002: Update documentation comments. (Closed) Base URL: git@github.com:dart-lang/crypto.git@master
Patch Set: Code review changes Created 5 years, 3 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 d05922661e1f1a3ed0c071e6f4ac4cc8240b24bd..7041a6ff75c9d8f50c4641fdc41b269fafc2e4d2 100644
--- a/lib/src/sha1.dart
+++ b/lib/src/sha1.dart
@@ -10,19 +10,26 @@ import 'hash.dart';
import 'hash_base.dart';
import 'utils.dart';
-/**
- * SHA1 hash function implementation.
- */
+/// An implementation of the [SHA-1][rfc] hash function.
+///
+/// [rfc]: http://tools.ietf.org/html/rfc3174
abstract class SHA1 implements Hash {
factory SHA1() = _SHA1;
SHA1 newInstance();
}
+/// The concrete implementation of [SHA1].
+///
+/// This is separate so that it can extend [HashBase] without leaking additional
+/// public memebers.
class _SHA1 extends HashBase implements SHA1 {
+ /// The sixteen words from the original chunk, extended to 80 words.
+ ///
+ /// This is an instance variable to avoid re-allocating, but its data isn't
+ /// used across invocations of [updateHash].
final Uint32List _w;
- // Construct a SHA1 hasher object.
_SHA1()
: _w = new Uint32List(80),
super(16, 5, true) {
@@ -33,13 +40,10 @@ class _SHA1 extends HashBase implements SHA1 {
h[4] = 0xC3D2E1F0;
}
- // Returns a new instance of this Hash.
SHA1 newInstance() {
return new _SHA1();
}
- // Compute one iteration of the SHA1 algorithm with a chunk of
- // 16 32-bit pieces.
void updateHash(Uint32List m) {
assert(m.length == 16);
« 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