When using the hashsum CRC-32 algorithm to get the hash of the file, I get an error saying that it is not supported. Eventhough, the $rclone hashsum command give the CRC-32 as supported hash algorithm.
D:\Rclone>rclone hashsum CRC-32 remote:/tmp/archive/FULL_DESC.csv.zip --config D:\Rclone\rclone.conf --log-level DEBUG
2020/04/24 15:56:21 DEBUG : rclone: Version "v1.51.0" starting with parameters ["rclone" "hashsum" "CRC-32" "remote:/tmp/archive/FULL_DESC.csv.zip" "--config" "D:\\Rclone\\rclone.conf" "--log-level" "DEBUG"]
2020/04/24 15:56:21 DEBUG : Using config file from "D:\\Rclone\\rclone.conf"
2020/04/24 15:56:21 DEBUG : sftp://user@XXXX:22//tmp/archive/FULL_DESC.csv.zip: New
connection 10.XX.XX.XX:56103->10.XX.XX.XX:22 to "SSH-2.0-OpenSSH_7.4"
UNSUPPORTED FULL_DESC.csv.zip
2020/04/24 15:56:21 Failed to hashsum: hash type not supported
D:\Rclone>rclone hashsum
Supported hashes are:
* MD5
* SHA-1
* Whirlpool
* CRC-32
* DropboxHash
* MailruHash
* QuickXorHash
D:\Rclone>rclone --version
rclone v1.51.0
- os/arch: windows/amd64
- go version: go1.13.7
Im running this commands on a windows machine.
OS Name: Microsoft Windows Server 2012 R2 Standard
OS Version: 6.3.9600 N/A Build 9600
OS Manufacturer: Microsoft Corporation
OS Configuration: Member Server
OS Build Type: Multiprocessor Free
System Manufacturer: VMware, Inc.
System Model: VMware Virtual Platform
System Type: x64-based PC
Processor(s): 1 Processor(s) Installed.
Remote server is a linux machine.
Question: Why am I getting this error even though CRC-32 is actually supported in the clone version I'm using?
The sftp backend uses the md5sum and the sha1sum binaries to support MD5 and SHA1. It would be possible to get it to support CRC-32 if there was a binary to support it.
From a quick test the cksum doesn't appear to be a CRC-32 - there are lots of different CRC routines alas.
If the remote server has rclone installed then you can run rclone hashsum on it.
I guess rclone could use itself as a hashing routine too over sftp - I hasn't thought of that - so instead of using the md5sum binary it could use rclone hashsum MD5...
Is there any particular reason you have to use CRC-32 - it is quite a weak checksum compared to MD5 for example. 3 bits of error can defeat CRC-32 IIRC.