diff options
author | obscuren <geffobscura@gmail.com> | 2014-09-23 01:34:31 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-09-23 01:34:31 +0800 |
commit | ce149d2733bd55e8e9b16dd4b60b6bad17c3d7d9 (patch) | |
tree | ac183aa3312a4589cb3e4995cc103cfa58ef95da /ethutil/bytes.go | |
parent | 8ef17c2fb138ae254a0cc7ac509a7ab1177ee4ac (diff) | |
parent | 7d08e4f7d14600ee4ed38fc9d435e9c2e0e0fdac (diff) | |
download | dexon-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.go | 16 |
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 |