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

Side by Side Diff: lib/src/hash.dart

Issue 1348983002: Update documentation comments. (Closed) Base URL: git@github.com:dart-lang/crypto.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « lib/src/crypto_utils.dart ('k') | lib/src/hash_base.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 library crypto.hash; 5 library crypto.hash;
6 6
7 /** 7 /// An interface for cryptographic hash functions.
8 * Interface for cryptographic hash functions. 8 ///
9 * 9 /// The [add] method adds data to the hash. The [close] method extracts the
10 * The [add] method is used to add data to the hash. The [close] method 10 /// message digest.
11 * is used to extract the message digest. 11 ///
12 * 12 /// If multiple instances of a given Hash is needed, the [newInstance] method ca n
Bob Nystrom 2015/09/17 17:11:56 Long.
nweiz 2015/09/17 20:06:41 Done.
13 * Once the [close] method has been called no more data can be added using the 13 /// provide a new instance.
14 * [add] method. If [add] is called after the first call to [close] a
15 * HashException is thrown.
16 *
17 * If multiple instances of a given Hash is needed the [newInstance]
18 * method can provide a new instance.
19 */
20 // TODO(floitsch): make Hash implement Sink, EventSink or similar. 14 // TODO(floitsch): make Hash implement Sink, EventSink or similar.
21 abstract class Hash { 15 abstract class Hash {
22 /** 16 /// Add a list of bytes to the hash computation.
23 * Add a list of bytes to the hash computation. 17 ///
24 */ 18 /// If [this] has already been closed, throws a [StateError].
25 void add(List<int> data); 19 void add(List<int> data);
26 20
27 /** 21 /// Finish the hash computation and extract the message digest as a list of
28 * Finish the hash computation and extract the message digest as 22 /// bytes.
29 * a list of bytes.
30 */
31 List<int> close(); 23 List<int> close();
32 24
33 /** 25 /// Returns a new instance of this hash function.
34 * Returns a new instance of this hash function.
35 */
36 Hash newInstance(); 26 Hash newInstance();
37 27
38 /** 28 /// The internal block size of the hash in bytes.
39 * Internal block size of the hash in bytes. 29 ///
40 * 30 /// This is exposed for use by the [HMAC] class, which needs to know the block
41 * This is exposed for use by the HMAC class which needs to know the 31 /// size for the [Hash] it uses.
42 * block size for the [Hash] it is using.
43 */
44 int get blockSize; 32 int get blockSize;
45 } 33 }
OLDNEW
« no previous file with comments | « lib/src/crypto_utils.dart ('k') | lib/src/hash_base.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698