I’m writing an application that convert data serialized in ruby (file A) to xml format (file B).
To avoid reconverting unchanged files i already added a modification date check: if the last modification in file A is older than the last modification in file B we can avoid a new conversion.
Unf. some file A is overwritten but mantains the same content. This makes the conversion process futile and i’d like to avoid it.
I was thinking of storing on the disk an hash of the last converted file A and then before converting i could check if the hash of the file had changed.
Is there a way to easily create such a hash code in ruby?
1 Answer