/SwiftCrypto

A simple wrapper in Swift around the CommonCrypto framework

Primary LanguageSwiftMIT LicenseMIT

SwiftCrypto

A simple wrapper in Swift around the CommonCrypto framework.

Build Status

Swift Package Manager

// 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"]
        ),
    ]
)

Usage

Digest

let hash = "string".sha512

HMAC

let hmac = "string".digest(.SHA512, key: "some key")