Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will renaming a file change its CRC?

Tags:

crc

As stated, will renaming a file change the CRC? I've checked in plain text files and it didn't. Does this apply to all files of all formats?

like image 824
Jonn Avatar asked Oct 06 '10 03:10

Jonn


2 Answers

CRC is calculated on the contents of the file. The file name is just an entry in the file system that allows access to the file. It's not part of the file itself, so it's not part of the CRC.

like image 121
Andrew Cooper Avatar answered Sep 22 '22 13:09

Andrew Cooper


CRC is normally calculated on file content, but there's no prison sentence prescribed for writing a CRC utility that includes the filename. Check your particular utility's documentation, or I'd say it's safe to trust the results implied by your experiment.

like image 21
Tony Delroy Avatar answered Sep 24 '22 13:09

Tony Delroy