From ba95849097f7a35d9f315a4f2e340d3ef944a306 Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 18 Feb 2014 01:32:20 +0100 Subject: [PATCH] Added hex method --- ethutil/helpers.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ethutil/helpers.go b/ethutil/helpers.go index 2e3aeb9a3..11a474081 100644 --- a/ethutil/helpers.go +++ b/ethutil/helpers.go @@ -58,3 +58,7 @@ func MatchingNibbleLength(a, b []int) int { func Hex(d []byte) string { return hex.EncodeToString(d) } +func ToHex(str string) []byte { + h, _ := hex.DecodeString(str) + return h +}