Small bug - empty files are not getting hashed

Small bug: empty files are not hashed, both in UI via standard columns and via FSUtil.hash(filepath, algo) or FSUtil.hash('', algo).

This causes an error in a script which iterates over all files and compares stored values to newly computed values.

I would not expect none data to have any hash.

Empty files do technically have a hash value but it seems cleaner to display nothing for them.

Couldn't the script check the file size to resolve that issue?

Empty strings are valid hashing inputs, e.g. to test integrity of the algorithm, see this discussion, and this.

This was not the case in v12 so that's what I did at the moment to fix the script, looked up the values for all supported hashes :slight_smile: but wanted to inform you just in case it wasn't a deliberate decision.

1 Like

Ah, if it has changed from 12 to 13 then we should probably change it back, as we don't want to break existing scripts.

1 Like

I am not saying they are not. Empty input hashes can be handy internally fe. when doing duplicate search. But visually, as Leo mentioned, it's more clear for them to be empty in the UI. FSUtil functions could work in such cases though - idc.

1 Like

You are going to end up like MS this way :slight_smile: I wonder if the SimCity memory allocator patch is still there in Windows 11.

1 Like

:smiley: Yeah, if I understand Leo correctly, visually it might make sense to other people, not to me but I'm probably not representative.

Quick demo for v12:

image

We'll change this in 13.5.1 (after 13.5 goes out), so that empty files are hashed again.

3 Likes