An implementation of SHA1 hashing.
SDKs
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
- Xcode 11.0+
Framework
- Apple Crypto
Kit
Declaration
struct SHA1
Overview
The Insecure
hash implements the Hash
protocol to produce a SHA1 digest (Insecure
).
You can compute the digest by calling the static hash(data:)
method once. Alternatively, if the data that you want to hash is too large to fit in memory, you can compute the digest iteratively by creating a new hash instance, calling the update(data:)
method repeatedly with blocks of data, and then calling the finalize()
method to get the result.
Important
This hash algorithm isn’t considered cryptographically secure, but is provided for backward compatibility with older services that require it. For new services, prefer one of the secure hashes, like SHA512
.