# Module ring::digest [−] [src]

SHA-2 and the legacy SHA-1 digest algorithm.

If all the data is available in a single contiguous slice then the `digest` function should be used. Otherwise, the digest can be calculated in multiple steps using `Context`.

## Structs

Algorithm | A digest algorithm.
Context | A context for multi-step (Init-Update-Finish) digest calculations.
Digest | A calculated digest value.

## Constants

MAX_BLOCK_LEN | The maximum block length (`Algorithm::block_len`) of all the algorithms in this module.
MAX_CHAINING_LEN | The maximum chaining length (`Algorithm::chaining_len`) of all the algorithms in this module.
MAX_OUTPUT_LEN | The maximum output length (`Algorithm::output_len`) of all the algorithms in this module.
SHA1_OUTPUT_LEN | The length of the output of SHA-1, in bytes.
SHA256_OUTPUT_LEN | The length of the output of SHA-256, in bytes.
SHA384_OUTPUT_LEN | The length of the output of SHA-384, in bytes.
SHA512_256_OUTPUT_LEN | The length of the output of SHA-512/256, in bytes.
SHA512_OUTPUT_LEN | The length of the output of SHA-512, in bytes.

## Statics

SHA1 | SHA-1 as specified in FIPS 180-4. Deprecated.
SHA256 | SHA-256 as specified in FIPS 180-4.
SHA384 | SHA-384 as specified in FIPS 180-4.
SHA512 | SHA-512 as specified in FIPS 180-4.
SHA512_256 | SHA-512/256 as specified in FIPS 180-4.

## Functions

digest | Returns the digest of `data` using the given digest algorithm.

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)