<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "OpenSSL",
  "identifier" : "/documentation/OpenSSL/SHA256",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "OpenSSL"
    ],
    "preciseIdentifier" : "s:7OpenSSL6SHA256O"
  },
  "title" : "SHA256"
}
-->

# SHA256

Namespace for the SHA-256 hashing algorithm.

```
enum SHA256
```

## Overview

`SHA256` exposes the canonical 32-byte / 256-bit digest defined by
[FIPS PUB 180-4](https://csrc.nist.gov/publications/detail/fips/180/4/final)
and [RFC 6234](https://datatracker.ietf.org/doc/html/rfc6234). It is
suitable for integrity checks, HMAC-SHA256 key derivation, and
content-addressed identifiers (JWT payload fingerprints, Nostr event
IDs per NIP-01, and Git-style blob hashes).

All entry points are `static` and live on this enum; the namespace is
caseless and cannot be instantiated. Typical calls go through
[`hash(data:)`](/documentation/OpenSSL/SHA256/hash(data:)) or [`hash(string:)`](/documentation/OpenSSL/SHA256/hash(string:)), both of which return a
[`SHA256.SHA256Digest`](/documentation/OpenSSL/SHA256/SHA256Digest).

> Note: Internally the implementation calls the legacy
> [`SHA256_Init`](https://docs.openssl.org/3.6/man3/SHA256_Init/),
> `SHA256_Update`, and `SHA256_Final` routines. Upstream marked these
> deprecated in OpenSSL 3.0 in favor of the `EVP_MD` high-level
> interface; this wrapper retains the legacy path for simplicity and
> may migrate to `EVP_MD` in a future release with no public-API
> change.

> SeeAlso: ``doc://OpenSSL/documentation/OpenSSL/SHA256/hash(data:)``, ``doc://OpenSSL/documentation/OpenSSL/SHA256/hash(string:)``,
> ``doc://OpenSSL/documentation/OpenSSL/SHA256/SHA256Digest``