Using B2 SHA1 hash during "check --read-data"?

I notice that the B2 API supports returning SHA1 checksums in their b2_get_file_info API.

I know that during check --read-data, restic downloads all packs and computes their SHA2 hash. I’m wondering if the SHA1 could somehow be leveraged to obviate downloading all that data for B2. I know SHA1 is less robust than SHA2, and you use the SHA2 hash for the ID, so it’s not exactly a drop-in solution. But wondering if this could somehow be used.

I also wonder why Backblaze decided to go with SHA1… maybe a performance tradeoff.

I don’t have any idea why they chose SHA1, maybe the’re using it internally. Restic uses SHA256 everywhere, and we don’t record the SHA1 hash of any files (and it cannot be computed from the data we have without downloading the file itself), so I can see no way to use this.

1 Like