aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil/encoding.go
diff options
context:
space:
mode:
authorMaran <maran.hidskes@gmail.com>2014-05-27 16:29:47 +0800
committerMaran <maran.hidskes@gmail.com>2014-05-27 16:29:47 +0800
commit817def000ba6488b3999fa9b8eac9fce43984f19 (patch)
tree4f5f0efa5ae670bc658ef0bce123a44a0644f1f5 /ethutil/encoding.go
parent2232974cda9ed73c62a370545742ef88332c5f1e (diff)
parent6e24d603a157ba6f66d49132d16221d9adbdff4d (diff)
downloadgo-tangerine-817def000ba6488b3999fa9b8eac9fce43984f19.tar
go-tangerine-817def000ba6488b3999fa9b8eac9fce43984f19.tar.gz
go-tangerine-817def000ba6488b3999fa9b8eac9fce43984f19.tar.bz2
go-tangerine-817def000ba6488b3999fa9b8eac9fce43984f19.tar.lz
go-tangerine-817def000ba6488b3999fa9b8eac9fce43984f19.tar.xz
go-tangerine-817def000ba6488b3999fa9b8eac9fce43984f19.tar.zst
go-tangerine-817def000ba6488b3999fa9b8eac9fce43984f19.zip
Merge branch 'develop' of github.com:ethereum/eth-go into develop
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)
+}