verify(_:hash:)

Verify text and hash match

Bcrypt.swift:74
static func verify(_ text: String, hash: String) -> Bool

Parameters

text

plain text

hash

hashed data

The Bcrypt functions are designed to be slow to make them hard to crack. It is best not to run these functions on the default Task executor as this will block other tasks from running. You are better to run them on another thread e.g.

try await NIOThreadPool.singleton.runIfActive {
    self.hash(text, cost: cost)
}