This is the Perfect-BCrypt module written in Swift and adopted to use in iOS as a CocoaPod dependency. The original module is being used in the Perfect Toolkit, see PerfectSideRepos/PerfectBCrypt for more details
To run the example project, clone the repo, and run pod install
from the Example directory first.
import BCrypt
let password = "mypassword"
do {
let salt = try BCrypt.Salt()
let hashed = try BCrypt.Hash(password, salt: salt)
print("Hashed result is: \(hashed)")
}
catch {
print("An error occured: \(error)")
}
- iOS 10.0+
- Xcode 10.1+
- Swift 4.2+
BCrypt is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'BCrypt'
Alexander Berkunov, alexander.berkunov@gmail.com
BCrypt is available under the MIT license. See the LICENSE file for more info.