Skip to content

BinaryBirds/swift-bcrypt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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: