Creates a SHA256 hash function.
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
- Xcode 11.0+
- Apple Crypto
Initialize a new hash function by calling this method if you want to hash data iteratively, such as when you don’t have a buffer large enough to hold all the data at once. Provide data blocks to the hash function using the
update(buffer method. After providing all the data, call
finalize() to get the digest.
If your data fits into a single buffer, you can use the
hash(data:) or hash(bufferPointer:) method instead, to compute the digest in a single call.