vapor-community / bcrypt

Swift implementation of the BCrypt password hashing function

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BCrypt.Hash.make is very slow when used with Swift 5.2

balazskiss opened this issue · comments

I noticed that with the latest Xcode (11.4.1) making bcrypt hashes became super slow. It is now 5 times slower to make a hash than with Xcode 11.3.1.
Do you have an idea what made it this much slower?

It appears that Vapor started including a package using a C implementation of Bcrypt that is much faster: https://github.com/vapor/vapor/tree/main/Sources/CVaporBcrypt

It is also quite easy to extract into your own project.

Oh yeah we switched over to a bundled C implementation a long time ago. This repo needs to be archived. (We could do something in the future with some of the movable features in 5.9)