Skip to content

Enumeration

VaporBcrypt

Creates and verifies bcrypt hashes.
enum VaporBcrypt

Overview

Use BcryptDigest to create hashes for sensitive information like passwords.

try BcryptDigest.hash("vapor", cost: 12)

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

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

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

Topics

Type Methods

Relationships

Conforms To

  • Swift.Sendable
  • Swift.SendableMetatype