Type Method
hash(data:)
Hashes data with SHA-256 via the secp256k1_swift_sha256 shim and returns a 32-byte SHA256Digest.
- iOS 13.0+
- macCatalyst 13.0+
- macOS 10.15+
- tvOS 13.0+
- visionOS 1.0+
- watchOS 6.0+
static func hash<D>(data: D) -> SHA256Digest where D : DataProtocol
Parameters
-
data
-
The data to hash; no length restriction.
Return Value
A 32-byte SHA256Digest.
Discussion
The shim wraps the internal libsecp256k1 SHA-256 implementation so the Swift layer and the C layer share a single implementation for all hashing operations that feed into signing / verification.