ethereumjs / keythereum

Create, import and export Ethereum keys
MIT License
609 stars 163 forks source link

Remove validator package #31

Closed fanatid closed 7 years ago

fanatid commented 7 years ago

Issue #23

tinybike commented 7 years ago

Your isHexadecimal does not return a boolean -- it returns the match result (an array) if it finds a match, and null otherwise. I think it should be:

function isHexadecimal(s) {
  if (s.length % 2 === 0 && s.match(/^[0-9a-f]+$/i)) return true;
  return false;
}

But, why do we want to discard the validator library? Is it just to shrink the size, since validator has many other methods besides just isHexadecimal and isBase64?