aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-04-03 17:58:18 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-04-03 17:58:18 +0800
commita6ca3d0261e915ac495a15e676eba54c2b57c980 (patch)
treec0da6efb242c9b5dbafa43a8621de156147bf4ca /common
parent29a9c6bedd39f3432f8031475646ec151ca5caa5 (diff)
parent3e042317adc99438d6ffde0cbde4f0b40ad579c1 (diff)
downloaddexon-a6ca3d0261e915ac495a15e676eba54c2b57c980.tar
dexon-a6ca3d0261e915ac495a15e676eba54c2b57c980.tar.gz
dexon-a6ca3d0261e915ac495a15e676eba54c2b57c980.tar.bz2
dexon-a6ca3d0261e915ac495a15e676eba54c2b57c980.tar.lz
dexon-a6ca3d0261e915ac495a15e676eba54c2b57c980.tar.xz
dexon-a6ca3d0261e915ac495a15e676eba54c2b57c980.tar.zst
dexon-a6ca3d0261e915ac495a15e676eba54c2b57c980.zip
Merge pull request #626 from tgerring/rpcfabian
RPC Tests updates
Diffstat (limited to 'common')
-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"