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

common.IsHex makes no sense #15550

Closed
stevenroose opened this issue Nov 24, 2017 · 0 comments
Closed

common.IsHex makes no sense #15550

stevenroose opened this issue Nov 24, 2017 · 0 comments

Comments

@stevenroose
Copy link
Contributor

here

func IsHex(str string) bool {
	l := len(str)
	return l >= 4 && l%2 == 0 && str[0:2] == "0x"
}

This means that 0xHELLO_MY_NAME_IS_STEVEN_@#$^&* is valid hex, but 0102030f is not...

@fjl fjl closed this as completed in #15551 Dec 4, 2017
fjl pushed a commit that referenced this issue Dec 4, 2017
Also unexport isHex, hasHexPrefix because IsHexAddress is the only caller.

Fixes #15550
vincentserpoul pushed a commit to vincentserpoul/go-ethereum that referenced this issue Jan 9, 2018
Also unexport isHex, hasHexPrefix because IsHexAddress is the only caller.

Fixes ethereum#15550
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