Hash returns the hash of an object returning a lowercase hex string
(ctx context.Context, t hash.Type)
| 578 | |
| 579 | // Hash returns the hash of an object returning a lowercase hex string |
| 580 | func (o *Object) Hash(ctx context.Context, t hash.Type) (string, error) { |
| 581 | if t != hashType { |
| 582 | return "", hash.ErrUnsupported |
| 583 | } |
| 584 | if o.od.hash == "" && !o.fs.opt.Discard { |
| 585 | sum := md5.Sum(o.od.data) |
| 586 | o.od.hash = hex.EncodeToString(sum[:]) |
| 587 | } |
| 588 | return o.od.hash, nil |
| 589 | } |
| 590 | |
| 591 | // Size returns the size of an object in bytes |
| 592 | func (o *Object) Size() int64 { |
nothing calls this directly
no test coverage detected