Skip to content

Commit

Permalink
spec: clarify digest algorithm
Browse files Browse the repository at this point in the history
While other algorithm's can be used, signal the portability issues.

Fixes opencontainers#63

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
  • Loading branch information
vbatts committed Dec 20, 2019
1 parent 60be706 commit d8c049e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,10 @@ Some examples of _digests_ include the following:

| digest | description |
|-------------------------------------------------------------------------|----------------------------|
| sha256:6c3c624b58dbbcd3c0dd82b4c53f04194d1247c6eebdaab7c610cf7d66709b3b | Common sha256 based digest |
| `sha256:6c3c624b58dbbcd3c0dd82b4c53f04194d1247c6eebdaab7c610cf7d66709b3b` | Common sha256 based digest format |

While the _algorithm_ does allow one to implement a wide variety of algorithms, compliant implementations SHOULD use sha256.
Compliant implementations SHOULD use _algorithm_ of sha256.
The _algorithm_ does allow one to implement a wide variety of algorithms, though for portability sake it is best to keep this consistent because a translation of hashing algorithm used would produce a new object and new documents that reference it.
Heavy processing of input before calculating a hash is discouraged to avoid degrading the uniqueness of the _digest_ but some canonicalization MAY be performed to ensure consistent identifiers.

Let's use a simple example in pseudo-code to demonstrate a digest calculation:
Expand Down

0 comments on commit d8c049e

Please sign in to comment.