Created
June 4, 2019 19:44
-
-
Save fafk/9bcd2dab2b3a5d627ff626945016d4e1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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