Skip to content
Josh Wright edited this page Jan 14, 2021 · 3 revisions

Bcrypt

Creates and verifies BCrypt hashes.

var Bcrypt: BCryptDigest

Use BCrypt to create hashes for sensitive information like passwords.

try BCrypt.hash("vapor", cost: 4)

BCrypt uses a random salt each time it creates a hash. To verify hashes, use the verify(_:matches) method.

let hash = try BCrypt.hash("vapor", cost: 4)
try BCrypt.verify("vapor", created: hash) // true

https://en.wikipedia.org/wiki/Bcrypt

Alchemy
Types
Protocols
Global Typealiases
Global Variables
Global Functions
Fusion
Types
Protocols
Papyrus
Types
Protocols
Clone this wiki locally