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

Unified Diff: lib/src/barback/barback_server.dart

Issue 1902993003: Upgrade pub to work with crypto 1.0.0 or later. (Closed) Base URL: https://github.com/dart-lang/pub.git@master
Patch Set: Created 4 years, 8 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 | lib/src/utils.dart » ('j') | lib/src/utils.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/barback/barback_server.dart
diff --git a/lib/src/barback/barback_server.dart b/lib/src/barback/barback_server.dart
index 2e89284a9a8eda27be9be58d5555bdde6c508f7a..19082c9500a2f897f20c09efcd0fd564d36a9669 100644
--- a/lib/src/barback/barback_server.dart
+++ b/lib/src/barback/barback_server.dart
@@ -3,11 +3,9 @@
// BSD-style license that can be found in the LICENSE file.
import 'dart:async';
-import 'dart:convert';
import 'dart:io';
import 'package:barback/barback.dart';
-import "package:crypto/crypto.dart";
import 'package:mime/mime.dart';
import 'package:path/path.dart' as path;
import 'package:shelf/shelf.dart' as shelf;
@@ -163,12 +161,7 @@ class BarbackServer extends BaseServer<BarbackServerResult> {
var hashStream = pair.last;
// Allow the asset to be cached based on its content hash.
- var sha = new SHA1();
- await hashStream.forEach((chunk) {
- sha.add(chunk);
- });
-
- var assetSha = BASE64.encode(sha.close());
+ var assetSha = await sha1Stream(hashStream);
var previousSha = request.headers["if-none-match"];
var headers = {
« no previous file with comments | « no previous file | lib/src/utils.dart » ('j') | lib/src/utils.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698