Skip to content

Instantly share code, notes, and snippets.

@fafk
Created June 4, 2019 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fafk/9bcd2dab2b3a5d627ff626945016d4e1 to your computer and use it in GitHub Desktop.
Save fafk/9bcd2dab2b3a5d627ff626945016d4e1 to your computer and use it in GitHub Desktop.
export function validateBtcAddress(address) {
if (typeof address !== 'string') return false;
if (address.length < 26 || address.length > 35) return false;
return /^1/.test(address) || /^3/.test(address) || /^bc1/.test(address);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment