MCPcopy
hub / github.com/minio/minio-go / hashMaterials

Method hashMaterials

api.go:430–450  ·  view source on GitHub ↗

Hash materials provides relevant initialized hash algo writers based on the expected signature type. - For signature v4 request if the connection is insecure compute only sha256. - For signature v4 request if the connection is secure compute only md5. - For anonymous request compute md5.

(isMd5Requested, isSha256Requested bool)

Source from the content-addressed store, hash-verified

428// - For signature v4 request if the connection is secure compute only md5.
429// - For anonymous request compute md5.
430func (c *Client) hashMaterials(isMd5Requested, isSha256Requested bool) (hashAlgos map[string]md5simd.Hasher, hashSums map[string][]byte) {
431 hashSums = make(map[string][]byte)
432 hashAlgos = make(map[string]md5simd.Hasher)
433 if c.overrideSignerType.IsV4() {
434 if c.secure {
435 hashAlgos["md5"] = c.md5Hasher()
436 } else {
437 if isSha256Requested {
438 hashAlgos["sha256"] = c.sha256Hasher()
439 }
440 }
441 } else {
442 if c.overrideSignerType.IsAnonymous() {
443 hashAlgos["md5"] = c.md5Hasher()
444 }
445 }
446 if isMd5Requested {
447 hashAlgos["md5"] = c.md5Hasher()
448 }
449 return hashAlgos, hashSums
450}
451
452const (
453 unknown = -1

Callers 1

Calls 2

IsV4Method · 0.80
IsAnonymousMethod · 0.80

Tested by

no test coverage detected