aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/dexon-foundation/dexon-consensus/common/utils.go
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2018-11-02 12:04:20 +0800
committerWei-Ning Huang <w@dexon.org>2019-03-12 12:19:09 +0800
commit1e90f665fafb9bd4d5e12dd07585b99d7dc55dfb (patch)
tree7d8f5d9389bc1277a4ea5277278f03a55212404b /vendor/github.com/dexon-foundation/dexon-consensus/common/utils.go
parent012b3d933bd021e6487fe3f7178d99459fbfb326 (diff)
downloaddexon-1e90f665fafb9bd4d5e12dd07585b99d7dc55dfb.tar
dexon-1e90f665fafb9bd4d5e12dd07585b99d7dc55dfb.tar.gz
dexon-1e90f665fafb9bd4d5e12dd07585b99d7dc55dfb.tar.bz2
dexon-1e90f665fafb9bd4d5e12dd07585b99d7dc55dfb.tar.lz
dexon-1e90f665fafb9bd4d5e12dd07585b99d7dc55dfb.tar.xz
dexon-1e90f665fafb9bd4d5e12dd07585b99d7dc55dfb.tar.zst
dexon-1e90f665fafb9bd4d5e12dd07585b99d7dc55dfb.zip
Rename import due to dexon-consensus rename
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus/common/utils.go')
-rw-r--r--vendor/github.com/dexon-foundation/dexon-consensus/common/utils.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/common/utils.go b/vendor/github.com/dexon-foundation/dexon-consensus/common/utils.go
new file mode 100644
index 000000000..7e89c059d
--- /dev/null
+++ b/vendor/github.com/dexon-foundation/dexon-consensus/common/utils.go
@@ -0,0 +1,14 @@
+package common
+
+import (
+ "math/rand"
+)
+
+// NewRandomHash returns a random Hash-like value.
+func NewRandomHash() Hash {
+ x := Hash{}
+ for i := 0; i < HashLength; i++ {
+ x[i] = byte(rand.Int() % 256)
+ }
+ return x
+}