forked from TrueCloudLab/frostfs-sdk-go
[#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>
This commit is contained in:
parent
fd13e61266
commit
caa055236b
7 changed files with 53 additions and 35 deletions
|
@ -20,11 +20,11 @@ var errIncorrectID = errors.New("incorrect object identifier")
|
|||
|
||||
// CalculatePayloadChecksum calculates and returns checksum of
|
||||
// object payload bytes.
|
||||
func CalculatePayloadChecksum(payload []byte) *checksum.Checksum {
|
||||
func CalculatePayloadChecksum(payload []byte) checksum.Checksum {
|
||||
var res checksum.Checksum
|
||||
checksum.Calculate(&res, checksum.SHA256, payload)
|
||||
|
||||
return &res
|
||||
return res
|
||||
}
|
||||
|
||||
// CalculateAndSetPayloadChecksum calculates checksum of current
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue