aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil/encoding.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-27 07:08:51 +0800
committerobscuren <geffobscura@gmail.com>2014-05-27 07:08:51 +0800
commit5cdfee51437532ccfb49e874fdbbea2702c3d13f (patch)
treefe7178f2c877da1fca17dc3529f8a9d934ea2617 /ethutil/encoding.go
parent4c7bd75c1a4ccbed09a10c81dbfbbcffdc66c411 (diff)
downloaddexon-5cdfee51437532ccfb49e874fdbbea2702c3d13f.tar
dexon-5cdfee51437532ccfb49e874fdbbea2702c3d13f.tar.gz
dexon-5cdfee51437532ccfb49e874fdbbea2702c3d13f.tar.bz2
dexon-5cdfee51437532ccfb49e874fdbbea2702c3d13f.tar.lz
dexon-5cdfee51437532ccfb49e874fdbbea2702c3d13f.tar.xz
dexon-5cdfee51437532ccfb49e874fdbbea2702c3d13f.tar.zst
dexon-5cdfee51437532ccfb49e874fdbbea2702c3d13f.zip
New Trie iterator
Diffstat (limited to 'ethutil/encoding.go')
-rw-r--r--ethutil/encoding.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/ethutil/encoding.go b/ethutil/encoding.go
index 1f661947a..9fcdf3edf 100644
--- a/ethutil/encoding.go
+++ b/ethutil/encoding.go
@@ -59,3 +59,18 @@ func CompactHexDecode(str string) []int {
return hexSlice
}
+
+func DecodeCompact(key []int) string {
+ base := "0123456789abcdef"
+ var str string
+
+ for _, v := range key {
+ if v < 16 {
+ str += string(base[v])
+ }
+ }
+
+ res, _ := hex.DecodeString(str)
+
+ return string(res)
+}