diff options
author | Wei-Ning Huang <w@dexon.org> | 2018-10-09 12:19:33 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2018-10-09 12:20:07 +0800 |
commit | e29ec41836d09bf0dab4a76fa3c3edadc4f206a8 (patch) | |
tree | 335ec40facc10edf73a787391445700a4741d96e | |
parent | 9267d50de25ddf0f280eee797e2030ea989294e4 (diff) | |
download | dexon-consensus-e29ec41836d09bf0dab4a76fa3c3edadc4f206a8.tar.gz dexon-consensus-e29ec41836d09bf0dab4a76fa3c3edadc4f206a8.tar.zst dexon-consensus-e29ec41836d09bf0dab4a76fa3c3edadc4f206a8.zip |
common: add Bytes() method to Hash
-rw-r--r-- | common/types.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/common/types.go b/common/types.go index 1bda164..f51a519 100644 --- a/common/types.go +++ b/common/types.go @@ -53,6 +53,11 @@ func (h Hash) String() string { return hex.EncodeToString([]byte(h[:])) } +// Bytes return the hash as slice of bytes. +func (h Hash) Bytes() []byte { + return h[:] +} + // Equal compares if two hashes are the same. func (h Hash) Equal(hp Hash) bool { return h == hp |