aboutsummaryrefslogtreecommitdiffstats
path: root/common/bytes.go
diff options
context:
space:
mode:
Diffstat (limited to 'common/bytes.go')
-rw-r--r--common/bytes.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/bytes.go b/common/bytes.go
index 0c257a1ee..c82e61624 100644
--- a/common/bytes.go
+++ b/common/bytes.go
@@ -31,6 +31,15 @@ func ToHex(b []byte) string {
return "0x" + hex
}
+// ToHexArray creates a array of hex-string based on []byte
+func ToHexArray(b [][]byte) []string {
+ r := make([]string, len(b))
+ for i := range b {
+ r[i] = ToHex(b[i])
+ }
+ return r
+}
+
// FromHex returns the bytes represented by the hexadecimal string s.
// s may be prefixed with "0x".
func FromHex(s string) []byte {