Home  >  Q&A  >  body text

md5 - How to verify local directory and remote directory in python?

The current situation is like this. In the background of python web, the local directory is transferred to the remote server, but how to verify that the transfer is correct? Are the directories before and after the transfer consistent? Is there any way to verify it?

巴扎黑巴扎黑2702 days ago691

reply all(2)I'll reply

  • 迷茫

    迷茫2017-05-27 17:41:50

    You can package the local directory, calculate the sha1 value of the package, and then name the package with sha1. After uploading to the remote server, verify the sha1 value and decompress it.

    reply
    0
  • 世界只因有你

    世界只因有你2017-05-27 17:41:50

    You can use md5 to calculate a value for the local directories that need to be uploaded, and then put their md5 results together and calculate again. Use the same operation on the server side to calculate again. If the two md5 results are consistent, it is consistent

    You can also do it without gathering. Make a transfer list, then add the md5 of the corresponding file, and then calculate the md5 with the server based on the transfer list. If it is consistent, the file is correct. If it is inconsistent, it proves that the file is correct. Maybe it’s wrong

    reply
    0
  • Cancelreply