Skip to content

Enumeration

VaporBcrypt

Creates and verifies bcrypt hashes.
enum VaporBcrypt

Overview

Use VaporBcrypt to create hashes for sensitive information like passwords.

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

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

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

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

Topics

Type Methods

Relationships

Conforms To

  • Swift.Sendable
  • Swift.SendableMetatype