This repository has been archived by the owner on Jul 3, 2019. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes all digest-related API bits. Now, instead of having to always pair up a
digest
with ahashAlgorithm
, a single string can be used. This is based on the Subresource Integrity spec, which is what browsers use for this sort of checking.This is a major breaking change because it changes the way all the
digest
options are used. It'll also bump the index version again.This PR will not change content storage format: that should keep using the
hex
version of the digest, because the current filesystem structure is much more friendly across platforms. base64 encodings have case-variance (which messed with OSX and Windows), as well as some characters like/
and+
that will inevitably confuse someone's tool/script at some point.Note that
hashAlgorithm
will still be an option forput/put.stream
.The biggest reason for doing this is realizing how unergonomic it was to always have to pass in
hashAlgorithm
whenever get/put was being used with a digest -- in some cases requiring modification ofopts
. It has also been a source of bugs both in pacote and cacache itself. I'd much rather simplify this by keeping these two bits together.