<!--
{
  "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/Digest",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Apple CryptoKit"
    ],
    "preciseIdentifier" : "s:9CryptoKit6DigestP"
  },
  "title" : "Digest"
}
-->

# Digest

A type that represents the output of a hash.

```
@preconcurrency protocol Digest : ContiguousBytes, CustomStringConvertible, Hashable, Sendable, Sequence where Self.Element == UInt8
```

## Topics

### Getting the digest length

[`static var byteCount: Int`](/documentation/CryptoKit/Digest/byteCount)

The number of bytes in the digest.

### Comparing digests

[`static func == <D>(Self, D) -> Bool`](/documentation/CryptoKit/Digest/==(_:_:)-7yz3z)

Determines whether a digest is equivalent to a collection of contiguous
bytes.

[`static func == (Self, Self) -> Bool`](/documentation/CryptoKit/Digest/==(_:_:)-6m59k)

Determines whether two digests are equal.

### Default Implementations

[CustomStringConvertible Implementations](/documentation/CryptoKit/Digest/CustomStringConvertible-Implementations)

## Relationships

### Conforming Types

[`MD5Digest`](/documentation/CryptoKit/Insecure/MD5Digest)

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

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

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

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

[`SHA1Digest`](/documentation/CryptoKit/Insecure/SHA1Digest)

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

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

### Inherits From

[`ContiguousBytes`](/documentation/Foundation/ContiguousBytes)

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

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

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

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

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

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

---

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)