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

Nor able to pass validation of address #3

Open
nitinsinghit opened this issue Nov 19, 2014 · 0 comments
Open

Nor able to pass validation of address #3

nitinsinghit opened this issue Nov 19, 2014 · 0 comments

Comments

@nitinsinghit
Copy link

var cs = require('coinstring');
cs.isValid(req.param('address') , 0x00) .

This check fails on me. Weird thing is that this check works on other laptops. Function below error out only on my laptop where versionCompare and version comparison is not buffer but on other machines comparison is buffer. Not sure whats going on. Please advice

function decode(base58str, version) {
var buf = base58.decode(base58str)
var versionLength

if (version == null)
versionLength = 0
else {
if (typeof version == 'number')
version = new Buffer([version])

versionLength = version.length
var versionCompare = buf.slice(0, versionLength)
if (versionCompare !== version) ///on debug I see on other machines that versionCompare and version are buffer
  throw new Error('Invalid version')

}
}

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

No branches or pull requests

1 participant