dchest / scrypt-async-js

Fast "async" scrypt implementation in JavaScript
http://dchest.github.io/scrypt-async-js/
BSD 2-Clause "Simplified" License
139 stars 26 forks source link

Fix bug that occurs with data structures that don't support .push when password.length > 64 #43

Closed TotalTechGeek closed 6 years ago

TotalTechGeek commented 6 years ago

This is my PR for #42

I also fixed a bug related to one of your unit tests.

Calls to scrypt with the new API always throw an error if the callback is not defined, this might need a separate fix, or a specific error created for it,

Your "p < 1" detection code didn't get executed with the new API, because if set to zero the value will silently be set to 1.

dchest commented 6 years ago

Thanks! The thing with zero p and dkLen opts taking a default value, now changed to throwing would be a breaking change, so let's keep it the way it was for now. I want to release just a bug fixed version, and then we can fix it in the next major version.

TotalTechGeek commented 6 years ago

Alright! I'll remove the "fixes," and they can be added back in at a later date.

dchest commented 6 years ago

Thanks again! Merged, and will release soon.