aboutsummaryrefslogtreecommitdiffstats
path: root/common/bytes.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-04-03 23:09:21 +0800
committerobscuren <geffobscura@gmail.com>2015-04-03 23:09:21 +0800
commit11d90d9b2229917b00459ffbad4b1ff6e3c180a2 (patch)
tree187751e89b8654f575da00b4ff80fc5fc1813244 /common/bytes.go
parent4558e04c0d35d2d057a7182593e8baaa2d3adec0 (diff)
parent47feff361113fd4b28f81f7b7094c4662b4e8786 (diff)
downloadgo-tangerine-11d90d9b2229917b00459ffbad4b1ff6e3c180a2.tar.gz
go-tangerine-11d90d9b2229917b00459ffbad4b1ff6e3c180a2.tar.zst
go-tangerine-11d90d9b2229917b00459ffbad4b1ff6e3c180a2.zip
Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop
Diffstat (limited to 'common/bytes.go')
-rw-r--r--common/bytes.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/bytes.go b/common/bytes.go
index 2d885ac74..5bdacd810 100644
--- a/common/bytes.go
+++ b/common/bytes.go
@@ -127,6 +127,11 @@ func CopyBytes(b []byte) (copiedBytes []byte) {
return
}
+func HasHexPrefix(str string) bool {
+ l := len(str)
+ return l >= 2 && str[0:2] == "0x"
+}
+
func IsHex(str string) bool {
l := len(str)
return l >= 4 && l%2 == 0 && str[0:2] == "0x"