From 5cdfee51437532ccfb49e874fdbbea2702c3d13f Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 27 May 2014 01:08:51 +0200 Subject: New Trie iterator --- ethutil/encoding.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'ethutil/encoding.go') 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) +} -- cgit v1.2.3