diff options
author | obscuren <geffobscura@gmail.com> | 2014-05-27 07:08:51 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-05-27 07:08:51 +0800 |
commit | 5cdfee51437532ccfb49e874fdbbea2702c3d13f (patch) | |
tree | fe7178f2c877da1fca17dc3529f8a9d934ea2617 /ethutil/encoding.go | |
parent | 4c7bd75c1a4ccbed09a10c81dbfbbcffdc66c411 (diff) | |
download | go-tangerine-5cdfee51437532ccfb49e874fdbbea2702c3d13f.tar go-tangerine-5cdfee51437532ccfb49e874fdbbea2702c3d13f.tar.gz go-tangerine-5cdfee51437532ccfb49e874fdbbea2702c3d13f.tar.bz2 go-tangerine-5cdfee51437532ccfb49e874fdbbea2702c3d13f.tar.lz go-tangerine-5cdfee51437532ccfb49e874fdbbea2702c3d13f.tar.xz go-tangerine-5cdfee51437532ccfb49e874fdbbea2702c3d13f.tar.zst go-tangerine-5cdfee51437532ccfb49e874fdbbea2702c3d13f.zip |
New Trie iterator
Diffstat (limited to 'ethutil/encoding.go')
-rw-r--r-- | ethutil/encoding.go | 15 |
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) +} |