Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix#73: replaced .push with .concat as it is faster #88

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

erdahuja
Copy link

No description provided.

Copy link

@Ruffio Ruffio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this PR complete and tested? I see several issues:

  1. salt.concat is used but in line 85 'salt.join' is used/returned. When salt.concat is used salt.join shouldn't be nessecary.
  2. $2a$ is used in genSaltSync, but in tests it is tested for $2b$

@erdahuja
Copy link
Author

erdahuja commented Aug 25, 2018

@Ruffio Hi, i changed it into tests because salt2 is generated from bindings.genSalt instead of bcrypt.genSlat. Also the test would fail without my changes too. I checked it's 2b there. Am i missing something here?

Will fix the other one, yes I had that way too you are right. I am new to open source. Thanks for feedback :)

@erdahuja
Copy link
Author

So the tests are failing in master too. because of binding.genSaltSync defaults to 'b' minor.

https://www.dropbox.com/s/png23w5x5214zlb/Screenshot%202018-08-25%2017.37.33.png?dl=0

A simple fix would be to pass the second parameter: 'a' as a minor.

https://www.dropbox.com/s/8dnfks09hyye1sj/Screenshot%202018-08-25%2017.39.13.png?dl=0

Everyone happy :)

@Ruffio
Copy link

Ruffio commented Sep 7, 2018

@dcodeIO what do you think?

1 similar comment
@Ruffio
Copy link

Ruffio commented Jan 4, 2019

@dcodeIO what do you think?

@WebMatrixware
Copy link

I'm not sure that contact actually is faster anyway, based on these articles and tests I would say it is actually the other way around.

https://codeburst.io/jsnoob-push-vs-concat-basics-and-performance-comparison-7a4b55242fa9
https://dev.to/uilicious/javascript-array-push-is-945x-faster-than-array-concat-1oki

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants