BCryptSwift - 用 Swift 编写的 cocoapod.
还有一个 cocoapod BCrypt ,它实际上是Perfect (Swift 服务器端工具包)中使用的版本,但在 iOS 中作为 cocoa pod 依赖项使用。
使用示例:
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)")
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2772 次 |
| 最近记录: |