diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-18 20:46:55 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-03-18 20:46:55 +0800 |
commit | e30c32339132d678b428ae531932a3f048665f59 (patch) | |
tree | ec68d48217e26aeff8dd96b1d5f8a6abfef95ff7 /common | |
parent | 67c9d9c2fa6d1cb74188dccf7e25422db72983c8 (diff) | |
parent | 3ea99f989ff98432cbfa864d2e7e26628e16cc6f (diff) | |
download | go-tangerine-e30c32339132d678b428ae531932a3f048665f59.tar go-tangerine-e30c32339132d678b428ae531932a3f048665f59.tar.gz go-tangerine-e30c32339132d678b428ae531932a3f048665f59.tar.bz2 go-tangerine-e30c32339132d678b428ae531932a3f048665f59.tar.lz go-tangerine-e30c32339132d678b428ae531932a3f048665f59.tar.xz go-tangerine-e30c32339132d678b428ae531932a3f048665f59.tar.zst go-tangerine-e30c32339132d678b428ae531932a3f048665f59.zip |
merge develop
Diffstat (limited to 'common')
-rw-r--r-- | common/common.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/common/common.go b/common/common.go index 1371d18d4..155bb5c2a 100644 --- a/common/common.go +++ b/common/common.go @@ -65,6 +65,15 @@ func DefaultDataDir() string { } } +func ToHex(b []byte) string { + hex := Bytes2Hex(b) + // Prefer output of "0x0" instead of "0x" + if len(hex) == 0 { + hex = "0" + } + return "0x" + hex +} + func FromHex(s string) []byte { if len(s) > 1 { if s[0:2] == "0x" { |