Skip to content

Latest commit

 

History

History
34 lines (21 loc) · 586 Bytes

README.md

File metadata and controls

34 lines (21 loc) · 586 Bytes

Swift BCrypt

Install

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.

Usage example

Basic example

import Bcrypt

let digest = try Bcrypt.hash("binary-birds", cost: 6)
let res = try Bcrypt.verify("binary-birds", created: digest)

Credits

This code is derived from the Vapor web framework: