A simple wrapper in Swift around the CommonCrypto framework.
// swift-tools-version:5.0
import PackageDescription
let package = Package(
name: "YourProject",
dependencies: [
.package(url: "https://github.com/jernejstrasner/SwiftCrypto.git", from: "1.0.1")
],
targets: [
.target(
name: "YourTarget",
dependencies: ["SwiftCrypto"]
),
]
)
let hash = "string".sha512
let hmac = "string".digest(.SHA512, key: "some key")