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

Issue 1902993003: Upgrade pub to work with crypto 1.0.0 or later. (Closed)

Created:
4 years, 8 months ago by Bob Nystrom
Modified:
4 years, 8 months ago
Reviewers:
nweiz, kevmoo
CC:
reviews_dartlang.org
Base URL:
https://github.com/dart-lang/pub.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Upgrade pub to work with crypto 1.0.0 or later. This is necessary since the SDK's repo requires that. R=kevmoo@google.com Committed: https://github.com/dart-lang/pub/commit/217fc8ae2bdee58ebf4b11a6fa3d49624d90c0c4

Patch Set 1 #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+32 lines, -17 lines) Patch
M lib/src/barback/barback_server.dart View 2 chunks +1 line, -8 lines 0 comments Download
M lib/src/utils.dart View 2 chunks +29 lines, -5 lines 6 comments Download
M pubspec.yaml View 1 chunk +2 lines, -1 line 0 comments Download
M test/global/activate/activate_hosted_after_git_test.dart View 1 chunk +0 lines, -2 lines 0 comments Download
M test/transformer/gets_and_upgrades_a_package_with_a_dev_transformer_test.dart View 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 7 (2 generated)
Bob Nystrom
4 years, 8 months ago (2016-04-19 23:42:00 UTC) #2
kevmoo
lgtm
4 years, 8 months ago (2016-04-20 01:00:45 UTC) #3
Bob Nystrom
Committed patchset #1 (id:1) manually as 217fc8ae2bdee58ebf4b11a6fa3d49624d90c0c4 (presubmit successful).
4 years, 8 months ago (2016-04-20 01:30:25 UTC) #5
nweiz
https://codereview.chromium.org/1902993003/diff/1/lib/src/utils.dart File lib/src/utils.dart (right): https://codereview.chromium.org/1902993003/diff/1/lib/src/utils.dart#newcode12 lib/src/utils.dart:12: import "package:crypto/crypto.dart" as crypto; crypto is not intended to ...
4 years, 8 months ago (2016-04-21 19:04:38 UTC) #6
Bob Nystrom
4 years, 8 months ago (2016-04-21 20:23:20 UTC) #7
Message was sent while issue was closed.
https://codereview.chromium.org/1902993003/diff/1/lib/src/utils.dart
File lib/src/utils.dart (right):

https://codereview.chromium.org/1902993003/diff/1/lib/src/utils.dart#newcode12
lib/src/utils.dart:12: import "package:crypto/crypto.dart" as crypto;
On 2016/04/21 19:04:38, nweiz wrote:
> crypto is not intended to be imported with a prefix.

Pub defines a sha1() function so I needed to disambiguate it and this seemed the
least innocuous.

https://codereview.chromium.org/1902993003/diff/1/lib/src/utils.dart#newcode491
lib/src/utils.dart:491: hex.encode(crypto.sha1.convert(source.codeUnits).bytes);
On 2016/04/21 19:04:38, nweiz wrote:
>     crypto.sha1.convert(UTF8.encode(source)).toString()
> 
> Digest.toString() provides a hex representation, sha1 expects bytes, not
arbitrary integers.

TIL. Done. I'll send out a code review.

https://codereview.chromium.org/1902993003/diff/1/lib/src/utils.dart#newcode493
lib/src/utils.dart:493: /// Returns the base64-encoded sha1 hash of [stream].
On 2016/04/21 19:04:38, nweiz wrote:
> Why is this base64-encoded rather than hex-encoded?

It's annoying that this is different from the previous function, but it
preserves the same behavior we had before when this code was in barback_server.
I was trying to minimize the effect of this change since it's getting
cherry-picked. (I also think base64 is a better answer here since it leads to a
shorter string for something where minimizing transfer size is the main goal.)

Powered by Google App Engine
This is Rietveld 408576698