Scenery
I need to implement a file change check between 2 points of my application. * ¹
- Point 1 - Server - I have a folder where are some product images;
- Point 2 - Mobile Device - I have a catalog application that downloads these images from the Server to a specific folder on your sdcard;
Problem
I would like from time to time to compare the images of the Device, with the images of the Server, and to check if it hears some modification, and if there is a lower image again;
Requirements
- Synchronization is applied via the internet, so consider the size of the information passed on the network;
Technologies
The technologies I'm using are as follows:
- The Mobile Device Application is on Android;
- The WebService that checks and returns the image for the application is in C # (MVC Web API);
Question
One of the options I found to implement this is by hashs
. So
I would like to know if generating hash
of the file on the Device and compares it with the hash
of the file on the Server is efficient for that case? Or is there any better and more efficient option? (remembering that the Server may have multiple requests for concurrent hash
generation, is this a lightweight operation for the Server?).
* ¹ - The changes that should be relevant are those that are applied to the Server folder.
Note: When I say "efficiency", I mean: better reliability (I accept 99.999% of
hash
as quoted by @MiguelAngelo in the comments) and performance (involving here, time and resources, being in processing, or in network traffic).