Comments (4)
i'm guessing this is a problem w/ password hashing being slow.
- which swift version are you using?
- are you using bcrypt?
- if so, what's your cost factor.
- does the time it takes change in if built in release mode?
from bcrypt.
@tanner0101 Swift 4.0, BCrypt, cost factor 4 or 12 from slack and the code example.
This bug has been investigated by me and seems to be a compiler issue in Swift 4's debug compilation. Specifically the encipher
function. Running this on Release should fix all issues.
EDIT: My recommended (temporary) solution is running a different cost factor on debug mode (locally). Your live server should be compiled on release, regardless. So the performance should be good there
from bcrypt.
Oops, sorry. Missed that code was supplied. @bsarrazin can you verify if compiling release solves the problem? If so, I'd also recommend using a lower cost factor in development mode. That way you can continue to compile debug without having slow hashing.
This can be easily done by adding a Config/development/bcrypt.json
file with the lower cost factor.
Or conversely by adding a Config/production/bcrypt.json
with the higher cost factor and having the default Config/bcrypt.json
contain a lower one.
Additionally, you might consider using password auth for just login/signup and creating a token to verify subsequent requests. This is a lot more performant than hashing the password each request.
from bcrypt.
This is super old, unlikely to be still applicable, we can reopen if needed.
from bcrypt.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bcrypt.