Skip to main content

Module sha256

Module sha256 

Source
Expand description

sha256, as published in FIPS 180-4.

Here rather than behind spec/18-package-layout.md section 18.3’s dependency wall. The whole of the algorithm is one table of constants and two loops, the test vectors are published with it, and a hash a manifest names itself by is not a reason to take on a crate and everything it depends on. The other direction of that wall matters too: this runs over a manifest, so a change in what it answers would change what every recorded digest means, and a constant in this file cannot change underneath us the way a version resolution can.

It hashes a whole slice, and the caller that has a file reads the file. The largest thing it is asked about is a release artifact of a few tens of megabytes, on its way into the cache, which fits in memory on any machine that can run a compiler. A streaming interface would be more code for the same answer and no caller wants one.

Functions§

hex
The sha256 of these bytes, as sixty four lowercase hex characters.