aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil/bytes.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-09-23 01:34:31 +0800
committerobscuren <geffobscura@gmail.com>2014-09-23 01:34:31 +0800
commitce149d2733bd55e8e9b16dd4b60b6bad17c3d7d9 (patch)
treeac183aa3312a4589cb3e4995cc103cfa58ef95da /ethutil/bytes.go
parent8ef17c2fb138ae254a0cc7ac509a7ab1177ee4ac (diff)
parent7d08e4f7d14600ee4ed38fc9d435e9c2e0e0fdac (diff)
downloaddexon-ce149d2733bd55e8e9b16dd4b60b6bad17c3d7d9.tar
dexon-ce149d2733bd55e8e9b16dd4b60b6bad17c3d7d9.tar.gz
dexon-ce149d2733bd55e8e9b16dd4b60b6bad17c3d7d9.tar.bz2
dexon-ce149d2733bd55e8e9b16dd4b60b6bad17c3d7d9.tar.lz
dexon-ce149d2733bd55e8e9b16dd4b60b6bad17c3d7d9.tar.xz
dexon-ce149d2733bd55e8e9b16dd4b60b6bad17c3d7d9.tar.zst
dexon-ce149d2733bd55e8e9b16dd4b60b6bad17c3d7d9.zip
Merge branch 'release/0.6.5'
Diffstat (limited to 'ethutil/bytes.go')
-rw-r--r--ethutil/bytes.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/ethutil/bytes.go b/ethutil/bytes.go
index e38f89454..f151d16ee 100644
--- a/ethutil/bytes.go
+++ b/ethutil/bytes.go
@@ -9,6 +9,22 @@ import (
"strings"
)
+type Bytes []byte
+
+func (self Bytes) String() string {
+ return string(self)
+}
+
+func DeleteFromByteSlice(s [][]byte, hash []byte) [][]byte {
+ for i, h := range s {
+ if bytes.Compare(h, hash) == 0 {
+ return append(s[:i], s[i+1:]...)
+ }
+ }
+
+ return s
+}
+
// Number to bytes
//
// Returns the number in bytes with the specified base