<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoKit",
  "identifier" : "/documentation/CryptoKit/SHA384",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Apple CryptoKit"
    ],
    "preciseIdentifier" : "s:9CryptoKit6SHA384V"
  },
  "title" : "SHA384"
}
-->

# SHA384

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

```
struct SHA384
```

## Overview

The [`SHA384`](/documentation/CryptoKit/SHA384) hash implements the [`HashFunction`](/documentation/CryptoKit/HashFunction) protocol for the
specific case of SHA-2 hashing with a 384-bit digest ([`SHA384Digest`](/documentation/CryptoKit/SHA384Digest)).
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()`](/documentation/CryptoKit/SHA384/finalize()) method to get the result.

## Topics

### Specifying the output type

[`Digest`](/documentation/CryptoKit/SHA384/Digest)

The digest type for a SHA384 hash function.

[`SHA384Digest`](/documentation/CryptoKit/SHA384Digest)

The output of a Secure Hashing Algorithm 2 (SHA-2) hash with a 384-bit digest.

### Computing a hash in one call

### Computing a hash iteratively

[`init()`](/documentation/CryptoKit/SHA384/init())

Creates a SHA384 hash function.

[`update(bufferPointer:)`](/documentation/CryptoKit/SHA384/update(bufferPointer:))

Incrementally updates the hash function with the contents of the buffer.

[`finalize()`](/documentation/CryptoKit/SHA384/finalize())

Finalizes the hash function and returns the computed digest.

### Inspecting hash information

[`byteCount`](/documentation/CryptoKit/SHA384/byteCount)

The number of bytes in a SHA384 digest.

[`blockByteCount`](/documentation/CryptoKit/SHA384/blockByteCount)

The number of bytes that represents the hash function’s internal state.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`Escapable`](/documentation/Swift/Escapable)

[`HashFunction`](/documentation/CryptoKit/HashFunction)

[`Copyable`](/documentation/Swift/Copyable)

---

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)