Questions tagged [md5-file]

72 questions
34
votes
4 answers

Will md5(file_contents_as_string) equal md5_file(/path/to/file)?

If I do: ...will this always produce the same hash as:
Tom
  • 1,055
  • 2
  • 14
  • 21
20
votes
5 answers

How can I read/stream a file without loading the entire file into memory?

How can I read an arbitrary file and process it "piece by piece" (meaning byte by byte or some other chunk size that would give the best read performance) without loading the entire file into memory? An example of processing would be to generate an…
Howiecamp
  • 2,981
  • 6
  • 38
  • 59
15
votes
3 answers

Zip files contain same files but have different hashes?

I have created hundreds of folders and text files using php, I then add them to a zip archive. This all works fine but if I create another zip archive using the same folders and files, the new archive will have a different hash to the first one.…
arbme
  • 4,831
  • 11
  • 44
  • 57
13
votes
5 answers

Is there an elegant way to check file integrity with md5 in ansible using md5 files fetched from server?

I have several files on a server that I need to download from an ansible playbook, but because the connection has good chances of interruption I would like to check their integrity after download. I'm considering two approaches: Store the md5 of…
10
votes
2 answers

C# calculate MD5 for opened file?

how I can calculate MD5 hash for a file that is open or used by a process? the files can be txt or and exe my current code return error for an exe because it is running here is my current code public static string GetMd5HashFromFile(string…
Data-Base
  • 8,418
  • 36
  • 74
  • 98
10
votes
8 answers

A way to make md5_file() faster?

I currently use md5_file() to run through about 15 URLs and verify their MD5 hashes. Is there a way that I can make this faster? It takes far too long to run through all of them.
Rob
  • 7,980
  • 30
  • 75
  • 115
7
votes
4 answers

How a download user checks md5 after file download?

We may notice many download sites provide md5 string. For example, when I download ABC.zip, along with an md5 string like: “2743a6a9fe6f873df1c7ed8ac91df5d7 *ABC.zip”. I know the idea behind it, it’s Digest algorithm to prevent file forge. My…
卢声远 Shengyuan Lu
  • 31,208
  • 22
  • 85
  • 130
5
votes
1 answer

NodeJS: scanning a directory tree is slow as hell

I have a NW.js app that simply (recursively) scans a directory tree and get the stats for each file/directory. It also performs a MD5 for files. I have 29k files, 850 folders, all for 120GB data. After almost 7 minutes, my code only scanned 4080…
Lideln Kyoku
  • 952
  • 9
  • 20
5
votes
1 answer

MD5 hash for zip files

Is it possible to generate MD5 hash for .zip files in java? All the examples I found were for .txt files. I want to know when we unzip the data, edit a file, again zip it and find the hash, will it be different from the original one?
Priya
  • 489
  • 1
  • 10
  • 20
4
votes
5 answers

PHP mechanism to prevent users from uploading the same file twice

I'm trying to allow users to upload files through a PHP website. Since all the files are saved in a single folder on the server, it's conceivable (though admittedly with low probability) that two distinct users could upload two files that, while…
Magsol
  • 4,640
  • 11
  • 46
  • 68
4
votes
2 answers

Is there a way to add comments in md5 file?

I have a library of files. Each file has each own *.md5 file (created by Total Commander) with md5 hash and additional *.txt file with some comments. Is there any way to move these comments from *.txt file to *.md5 file (and delete *.txt file) in a…
Lex
  • 444
  • 1
  • 3
  • 12
4
votes
6 answers

How to use the xxxx.md5 file or how to remove .md5 extension?

I get files like this below: GT-I5500-CSC-SERJK1.tar.md5 This is what I want: GT-I5500-CSC-SERJK1.tar How can I get it? Can I just remove the md5 file extension?
louxiu
  • 2,830
  • 3
  • 28
  • 42
4
votes
2 answers

MD5 Hash, Python 3 . How to Generate In Python

I need advice on how to get the md5 hash for a zip file. I will be constantly downloading files from an ftp using ftplib. As you know ftplib cannot tell if a file has been modified or not. I want to use the md5 hash of each new file to tell if it…
Mo. Atairu
  • 753
  • 8
  • 15
4
votes
1 answer

md5_file() not working with remote content fetched by URL

Here is my code relating to the question: $theurl = trim($_POST['url']); $md5file = md5_file($theurl); if ($md5file != '96a0cec80eb773687ca28840ecc67ca1') { echo 'Hash doesn\'t match. Incorrect file. Reupload it and try again'; When I…
Rob
  • 7,980
  • 30
  • 75
  • 115
3
votes
0 answers

How to get md5sum of a file inside a zip, without extracting the zip

Is there any way to get the md5sum of a file inside a zip file, without extracting the zip ?. I have a zip file containing directories plugins, p2 and features where plugins directory contains lot of jar files. How can I get the md5sum of a given…
Kasun Siyambalapitiya
  • 3,956
  • 8
  • 38
  • 58
1
2 3 4 5