BinaryBirds / swift-bcrypt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

About


Languages

Language:C 75.0%Language:Swift 24.5%Language:Makefile 0.5%