2021-11-12 11:19:16 +00:00
|
|
|
package checksumtest
|
2021-11-08 10:04:45 +00:00
|
|
|
|
|
|
|
import (
|
2023-09-08 14:15:08 +00:00
|
|
|
"crypto/rand"
|
2021-11-08 10:04:45 +00:00
|
|
|
"crypto/sha256"
|
|
|
|
|
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
|
|
|
|
|
2023-09-08 14:15:08 +00:00
|
|
|
_, _ = rand.Read(cs[:])
|
2021-11-08 10:04:45 +00:00
|
|
|
|
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
|
|
|
}
|