Hash value for a file or folder

Other discussions about CSPro
leulae
Posts: 39
Joined: December 16th, 2016, 5:51 am

Hash value for a file or folder

Postby leulae » March 24th, 2018, 3:31 am

Dear all,

I upload text files to the server, then I need to get the Hash values to compare the files in server with files in client (PC / Android) to write confirm script / script to verify files which are identical.

if anyone help me to generate a hash value for a file or folder is highly appreciated

Thank you

Leulae

Gregory Martin
Posts: 1099
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Hash value for a file or folder

Postby Gregory Martin » March 26th, 2018, 10:43 am

You can generate a MD5 hash for a file using the diagnostics function. See more here:

http://www.csprousers.org/help/CSPro/di ... ction.html

josh
Posts: 1687
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Hash value for a file or folder

Postby josh » March 26th, 2018, 12:47 pm

Note that if you use the function syncfile(GET,...) with CSWeb, Dropbox or Bluetooth sync, CSPro already calculates the hash and only downloads the file if the hash on the server is different. Unfortunately this is not for syncfile(PUT,...) so for that you would need to calculate your own hash.


Return to “Other”