<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoKit",
  "identifier" : "/documentation/CryptoKit/SHA2_512",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "Apple CryptoKit"
    ],
    "preciseIdentifier" : "s:9CryptoKit8SHA2_512a"
  },
  "title" : "SHA2_512"
}
-->

# SHA2_512

An implementation of Secure Hashing Algorithm 2 (SHA-2) hashing with a
512-bit digest.

```
typealias SHA2_512 = SHA512
```

## Discussion

The [`SHA2_512`](/documentation/CryptoKit/SHA2_512) hash implements the [`HashFunction`](/documentation/CryptoKit/HashFunction) protocol for the
specific case of SHA-2 hashing with a 512-bit digest ([`SHA512Digest`](/documentation/CryptoKit/SHA512Digest)).
Larger digests take more space but are more secure.

You can compute the digest by calling the static `hash(data:)` method
once. Alternatively, if the data that you want to hash is too large to fit
in memory, you can compute the digest iteratively by creating a new hash
instance, calling the `update(data:)` method repeatedly with blocks of
data, and then calling the `finalize()` method to get the result.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)