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

WalletUtils.isValidAddress() 只检查String长度 #228

Open
chaoxinhu opened this issue Apr 16, 2019 · 0 comments
Open

WalletUtils.isValidAddress() 只检查String长度 #228

chaoxinhu opened this issue Apr 16, 2019 · 0 comments
Assignees

Comments

@chaoxinhu
Copy link

String addr1 = "0x0cc37d28ff272d0f92a402d29af4efc334bf3c7*";
return WalletUtils.isValidAddress(addr1);

这里返回的是true,因为代码里只做了长度检查

建议:首先检查是否为Hex字符串
WeID里面使用的正则表达式:0x[a-fA-f0-9]{40}

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

4 participants