"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
hash: add SHA512 support for file hashes
Enduriela9c7c493cfee
diff --git a/fs/hash/hash.go b/fs/hash/hash.goindex 23956cee6..82caafd2c 100644--- a/fs/hash/hash.go+++ b/fs/hash/hash.go@@ -5,6 +5,7 @@ import ("crypto/md5""crypto/sha1""crypto/sha256"+ "crypto/sha512""encoding/base64""encoding/hex""errors"@@ -87,6 +88,9 @@ var (// SHA256 indicates SHA-256 supportSHA256 Type++ // SHA512 indicates SHA-512 support+ SHA512 Type)func init() {@@ -95,6 +99,7 @@ func init() {Whirlpool = RegisterHash("whirlpool", "Whirlpool", 128, whirlpool.New)CRC32 = RegisterHash("crc32", "CRC-32", 8, func() hash.Hash { return crc32.NewIEEE() })SHA256 = RegisterHash("sha256", "SHA-256", 64, sha256.New)+ SHA512 = RegisterHash("sha512", "SHA-512", 128, sha512.New)}// Supported returns a set of all the supported hashes bydiff --git a/fs/hash/hash_test.go b/fs/hash/hash_test.goindex 9215e9b9e..8fbd71bf9 100644--- a/fs/hash/hash_test.go+++ b/fs/hash/hash_test.go@@ -77,6 +77,7 @@ var hashTestSet = []hashTest{hash.Whirlpool: "eddf52133d4566d763f716e853d6e4efbabd29e2c2e63f56747b1596172851d34c2df9944beb6640dbdbe3d9b4eb61180720a79e3d15baff31c91e43d63869a4",hash.CRC32: "a6041d7e",hash.SHA256: "c839e57675862af5c21bd0a15413c3ec579e0d5522dab600bc6c3489b05b8f54",+ hash.SHA512: "008e7e9b5d94d37bf5e07c955890f730f137a41b8b0db16cb535a9b4cb5632c2bccff31685ec470130fe10e2258a0ab50ab587472258f3132ccf7d7d59fb91db",},},// Empty data set@@ -88,6 +89,7 @@ var hashTestSet = []hashTest{hash.Whirlpool: "19fa61d75522a4669b44e39c1d2e1726c530232130d407f89afee0964997f7a73e83be698b288febcf88e3e03c4f0757ea8964e59b63d93708b138cc42a66eb3",hash.CRC32: "00000000",hash.SHA256: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",+ hash.SHA512: "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e",},},}