hash(data:)
Computes the digest of the bytes in the given data instance and returns the computed digest.
Declaration
static func hash<D>(data: D) -> Self.Digest where D : DataProtocolParameters
- data:
The data whose digest the hash function should compute. This can be any type that conforms to Dataprotocol, like Data or an array of Uint8 instances.
Return Value
The computed digest of the data.
Discussion
Use this method if all your data fits into a single data instance. If the data you want to hash is too large, initialize a hash function and use the update(data:) and finalize() methods to compute the digest in blocks.