Monday 6 February 2023

Does the hash of a file change if the filename changes?

 

Does the hash of a file change if the filename changes?

 

Not as far as I can tell after a simple test.

$ echo some contents > testfile
$ shasum testfile 
3a2be7b07a1a19072bf54c95a8c4a3fe0cdb35d4  testfile
$ mv testfile newfile
$ shasum newfile 
3a2be7b07a1a19072bf54c95a8c4a3fe0cdb35d4  newfile

 

No comments:

Post a Comment

Note: only a member of this blog may post a comment.

Blog Archive