Generic Type Method

hash(data:)

Computes the MD5 digest of the bytes in the given data instance and returns the computed digest.

Declaration

static func hash<D>(data: D) -> Insecure.MD5Digest where D : DataProtocol

Parameters

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.