2021-11-12 11:19:16 +00:00
|
|
|
package checksumtest
|
2021-11-08 10:04:45 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"crypto/sha256"
|
|
|
|
"math/rand"
|
|
|
|
|
2023-03-07 11:20:03 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-sdk-go/checksum"
|
2021-11-08 10:04:45 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// Checksum returns random checksum.Checksum.
|
2021-03-04 11:38:23 +00:00
|
|
|
func Checksum() checksum.Checksum {
|
2021-11-08 10:04:45 +00:00
|
|
|
var cs [sha256.Size]byte
|
|
|
|
|
|
|
|
rand.Read(cs[:])
|
|
|
|
|
2021-03-22 10:56:18 +00:00
|
|
|
var x checksum.Checksum
|
2021-11-08 10:04:45 +00:00
|
|
|
|
|
|
|
x.SetSHA256(cs)
|
|
|
|
|
2021-03-04 11:38:23 +00:00
|
|
|
return x
|
2021-11-08 10:04:45 +00:00
|
|
|
}
|