frostfs-sdk-go/checksum/test/generate.go
Evgenii Stratonikov d6b72453fc [#64] object/test: reuse checksum and signature generators
These were missing from #53.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
2021-11-09 09:57:37 +03:00

21 lines
284 B
Go

package test
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[:])
x := checksum.New()
x.SetSHA256(cs)
return x
}