frostfs-sdk-go/checksum/test/generate.go
Pavel Karpy caa055236b [#170] checksum: Do not use pointers
Do not return pointers from getters. Do not pass pointers to the methods
that does not modify the checksum. Add `Empty` method.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
2022-04-13 10:53:57 +03:00

21 lines
295 B
Go

package checksumtest
import (
"crypto/sha256"
"math/rand"
"github.com/nspcc-dev/neofs-sdk-go/checksum"
)
// Checksum returns random checksum.Checksum.
func Checksum() checksum.Checksum {
var cs [sha256.Size]byte
rand.Read(cs[:])
var x checksum.Checksum
x.SetSHA256(cs)
return x
}