Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

fs/hash: fix xxh128 hasher size

Yuhang Cao710514afb392
diff --git a/fs/hash/hash.go b/fs/hash/hash.go
index 634548a96..8674efae0 100644
--- a/fs/hash/hash.go
+++ b/fs/hash/hash.go
@@ -114,6 +114,11 @@ func (h *xxh128Hasher) Sum(b []byte) []byte {
return buf[:]
}
+// Size returns the number of bytes Sum will return.
+func (h *xxh128Hasher) Size() int {
+ return 16
+}
+
func init() {
MD5 = RegisterHash("md5", "MD5", 32, md5.New)
SHA1 = RegisterHash("sha1", "SHA-1", 40, sha1.New)