Hash returns the MD5 of an object returning a lowercase hex string
(ctx context.Context, t hash.Type)
| 253 | |
| 254 | // Hash returns the MD5 of an object returning a lowercase hex string |
| 255 | func (o *Object) Hash(ctx context.Context, t hash.Type) (string, error) { |
| 256 | if t != hash.MD5 { |
| 257 | return "", hash.ErrUnsupported |
| 258 | } |
| 259 | // Convert base64 encoded md5 into lower case hex |
| 260 | if o.md5 == "" { |
| 261 | err := o.readMetaData(ctx) |
| 262 | if err != nil { |
| 263 | return "", err |
| 264 | } |
| 265 | } |
| 266 | return o.md5, nil |
| 267 | } |
| 268 | |
| 269 | // ModTime returns the modification time of the object |
| 270 | // |
nothing calls this directly
no test coverage detected