<!--
{
  "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/Insecure/SHA1/finalize()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Apple CryptoKit"
    ],
    "preciseIdentifier" : "s:9CryptoKit8InsecureO4SHA1V8finalizeAC0D6DigestVyF"
  },
  "title" : "finalize()"
}
-->

# finalize()

Finalizes the hash function and returns the computed digest.

```
func finalize() -> Insecure.SHA1.Digest
```

## Return Value

The computed digest of the data.

## Discussion

Call this method after you provide the hash function with all the
data to hash by making one or more calls to the `update(data:)` or
[`update(bufferPointer:)`](/documentation/CryptoKit/Insecure/SHA1/update(bufferPointer:)) method. After finalizing the hash
function, discard it. To compute a new digest, create a new hash
function with a call to the [`init()`](/documentation/CryptoKit/Insecure/SHA1/init()) method.

---

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)