diff options
Diffstat (limited to 'ethutil')
-rw-r--r-- | ethutil/bytes.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ethutil/bytes.go b/ethutil/bytes.go index 500368017..b298675a2 100644 --- a/ethutil/bytes.go +++ b/ethutil/bytes.go @@ -83,3 +83,8 @@ func CopyBytes(b []byte) (copiedBytes []byte) { return } + +func IsHex(str string) bool { + l := len(str) + return l >= 4 && l%2 == 0 && str[0:2] == "0x" +} |