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 binary string comparison failure #9

Closed
wants to merge 1 commit into from

Conversation

deckar01
Copy link

@deckar01 deckar01 commented Jul 6, 2014

While replacing replacing bitpay/bitcore's base58 lib with base58-native as a dep, their tests failed due to this patch:
bitpay/bitcore#402

It seems that comparing strings generated with Buffer.toString() will give false positives for some special characters. Their solution was to encode the bytes as hex before comparison.

new Buffer('94', 'hex').toString() == new Buffer('93', 'hex').toString()
true

new Buffer('94', 'hex').toString('hex') == new Buffer('93', 'hex').toString('hex')
false

Fixes #10.

@deckar01
Copy link
Author

@gasteve The checksum verification is currently broken. Are there any comments that can be addressed to get this PR merged?

@deckar01
Copy link
Author

@gasteve Closing due to inactivity, but you should really fix this. Publishing cryptographic libraries, then not updating their vulnerabilities is malicious behavior.

@deckar01 deckar01 closed this Jun 21, 2016
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.

checksum verification isn't correct
1 participant