Giter Club home page Giter Club logo

Comments (4)

tanner0101 avatar tanner0101 commented on May 26, 2024

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.

Joannis avatar Joannis commented on May 26, 2024

@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.

screen shot 2017-10-26 at 00 18 39

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.

tanner0101 avatar tanner0101 commented on May 26, 2024

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.

bsrz avatar bsrz commented on May 26, 2024

This is super old, unlikely to be still applicable, we can reopen if needed.

from bcrypt.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.