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

Unified Diff: lib/src/digest.dart

Issue 1830773003: Add Digest.hashCode. (Closed) Base URL: git@github.com:dart-lang/crypto.git@master
Patch Set: Code review changes 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 | « no previous file | pubspec.yaml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/digest.dart
diff --git a/lib/src/digest.dart b/lib/src/digest.dart
index 2e92fe21c48485844a2ad9f54d3ff4b361c9d807..f33752afaee67939902e22217d06a582ba4f7767 100644
--- a/lib/src/digest.dart
+++ b/lib/src/digest.dart
@@ -2,6 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+import 'package:collection/collection.dart';
import 'package:convert/convert.dart';
/// A message digest as computed by a [Hash] or [HMAC] function.
@@ -28,6 +29,8 @@ class Digest {
return result == 0;
}
+ int get hashCode => const ListEquality().hash(bytes);
+
/// The message digest as a string of hexadecimal digits.
String toString() => hex.encode(bytes);
}
« no previous file with comments | « no previous file | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698