This makes sure that Apple devices use Apples newer CryptoKit library for generating a SHA256 hash for improved safety & performance.
Note that there was a need for double-checking with both #if canImport(CryptoKit) and if #available to ensure full compatibility with all platforms & devices. See also here.
This makes sure that Apple devices use Apples newer CryptoKit library for generating a SHA256 hash for improved safety & performance.
Note that there was a need for double-checking with both
#if canImport(CryptoKit)
andif #available
to ensure full compatibility with all platforms & devices. See also here.