Hash returns the requested hash of the contents
(ctx context.Context, h hash.Type)
| 267 | |
| 268 | // Hash returns the requested hash of the contents |
| 269 | func (o *MemoryObject) Hash(ctx context.Context, h hash.Type) (string, error) { |
| 270 | hash, err := hash.NewMultiHasherTypes(hash.Set(h)) |
| 271 | if err != nil { |
| 272 | return "", err |
| 273 | } |
| 274 | _, err = hash.Write(o.content) |
| 275 | if err != nil { |
| 276 | return "", err |
| 277 | } |
| 278 | return hash.Sums()[h], nil |
| 279 | } |
| 280 | |
| 281 | // SetModTime sets the metadata on the object to set the modification date |
| 282 | func (o *MemoryObject) SetModTime(ctx context.Context, modTime time.Time) error { |