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

# hash(into:)

Hashes the essential components of the digest by feeding them into the
given hash function.

```
func hash(into hasher: inout Hasher)
```

## Parameters

`hasher`

The hash function to use when combining the components of
the digest.

## Discussion

This method is part of the digest’s conformance to Swift standard library’s
<doc://com.apple.documentation/documentation/Swift/Hashable> protocol, making
it possible to compare digests. Don’t confuse that hashing with the
cryptographically secure hashing that you use to create the digest in the
first place by, for example, calling `SHA512/hash(data:)`.

---

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)