pcloud: add sha256 support - fixes #5496

This commit is contained in:
Ken Enrique Morel 2021-08-13 15:17:52 -04:00 committed by Nick Craig-Wood
parent 82ad9a30b9
commit 3626f10f26
5 changed files with 12 additions and 7 deletions

View file

@ -888,7 +888,7 @@ func (f *Fs) Hashes() hash.Set {
//
// https://forum.rclone.org/t/pcloud-to-local-no-hashes-in-common/19440
if f.opt.Hostname == "eapi.pcloud.com" {
return hash.Set(hash.SHA1)
return hash.Set(hash.SHA1 | hash.SHA256)
}
return hash.Set(hash.MD5 | hash.SHA1)
}
@ -937,7 +937,7 @@ func (o *Object) getHashes(ctx context.Context) (err error) {
// Hash returns the SHA-1 of an object returning a lowercase hex string
func (o *Object) Hash(ctx context.Context, t hash.Type) (string, error) {
if t != hash.MD5 && t != hash.SHA1 {
if t != hash.MD5 && t != hash.SHA1 && t != hash.SHA256 {
return "", hash.ErrUnsupported
}
if o.md5 == "" && o.sha1 == "" {