Add the repository as a dependency:
.package(url: "https://github.com/binarybirds/swift-bcrypt", from: "1.0.0"),
Add Bcrypt
to the target dependencies:
.product(name: "Bcrypt", package: "swift-bcrypt"),
Update the packages and you are ready.
Basic example
import Bcrypt
let digest = try Bcrypt.hash("binary-birds", cost: 6)
let res = try Bcrypt.verify("binary-birds", created: digest)
This code is derived from the Vapor web framework: