Skip to content

Commit c01553c

Browse files
committed
Address comments
1 parent 60312d9 commit c01553c

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

api-get-object-attributes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ type ObjectAttributesResponse struct {
8888
ETag string `xml:",omitempty"`
8989
StorageClass string
9090
ObjectSize int
91-
Checksum struct {
91+
Checksum struct {
9292
ChecksumCRC32 string `xml:",omitempty"`
9393
ChecksumCRC32C string `xml:",omitempty"`
9494
ChecksumCRC64NVME string `xml:",omitempty"`

api-s3-datatypes.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,9 @@ type ObjectPart struct {
305305
ChecksumCRC64NVME string
306306
ChecksumMD5 string
307307
ChecksumSHA512 string
308-
ChecksumXXHash64 string
309-
ChecksumXXHash3 string
310-
ChecksumXXHash128 string
308+
ChecksumXXHash64 string `xml:"ChecksumXXHASH64,omitempty"`
309+
ChecksumXXHash3 string `xml:"ChecksumXXHASH3,omitempty"`
310+
ChecksumXXHash128 string `xml:"ChecksumXXHASH128,omitempty"`
311311
}
312312

313313
// Checksum will return the checksum for the given type.

checksum.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
"sort"
3333
"strings"
3434

35-
xxhash "github.com/cespare/xxhash/v2"
35+
"github.com/cespare/xxhash/v2"
3636
"github.com/klauspost/crc32"
3737
"github.com/minio/crc64nvme"
3838
"github.com/zeebo/xxh3"
@@ -220,7 +220,9 @@ func (c ChecksumType) RawByteLen() int {
220220
return sha1.Size
221221
case ChecksumSHA256:
222222
return sha256.Size
223-
case ChecksumCRC64NVME, ChecksumXXHash64, ChecksumXXHash3:
223+
case ChecksumCRC64NVME:
224+
return crc64nvme.Size
225+
case ChecksumXXHash64, ChecksumXXHash3:
224226
return 8
225227
case ChecksumMD5:
226228
return md5.Size
@@ -285,7 +287,6 @@ func (c ChecksumType) EncodeToString(b []byte) string {
285287
}
286288

287289
// String returns the type as a string.
288-
// CRC32, CRC32C, SHA1, and SHA256 for valid values.
289290
// Empty string for unset and "<invalid>" if not valid.
290291
func (c ChecksumType) String() string {
291292
switch c & checksumMask {

0 commit comments

Comments
 (0)