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

Unified Diff: utils/pub/utils.dart

Issue 10694119: Make the Git source install to the system cache. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 5 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 | « utils/pub/system_cache.dart ('k') | utils/tests/pub/pub_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/utils.dart
diff --git a/utils/pub/utils.dart b/utils/pub/utils.dart
index 60f8ab09749a5303189b2d875dacc48554ed7633..6aef021573c852584606209f93fd363105431079 100644
--- a/utils/pub/utils.dart
+++ b/utils/pub/utils.dart
@@ -7,6 +7,8 @@
*/
#library('utils');
+#import('dart:crypto');
+
/** Thrown by methods that parse text when the text isn't a valid. */
class FormatException implements Exception {
final String message;
@@ -110,3 +112,9 @@ bool endsWithPattern(String str, Pattern matcher) {
}
return false;
}
+
+/**
+ * Returns the hex-encoded sha1 hash of [source].
+ */
+String sha1(String source) =>
+ CryptoUtils.bytesToHex(new SHA1().update(source.charCodes()).digest());
« no previous file with comments | « utils/pub/system_cache.dart ('k') | utils/tests/pub/pub_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698