aboutsummaryrefslogblamecommitdiffstats
path: root/common/utils.go
blob: 7e89c059d2bb998a53e45b5fcb474ceca99308f9 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
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
}