How to check file integrity
Is there any way in java to check file integrity in java.
Such as by implementing checksum machanism.
if its not possible in java could you please suggest me some other solution.
Is there any way in java to check file integrity in java.
Such as by implementing checksum machanism.
if its not possible in java could you please suggest me some other solution.
Why do you think you need to "check file integrity"? What does "checking file integrity" mean to you?
The file system, disk controller, etc. are responsible for making sure that the bytes that you try to write get written correctly. Assume that they work. If you have reason to believe otherwise, you need a diagnostic tool, maybe a new disk, not a Java program.
If "file integrity" to you means that your file has a certain format, then sure, you can implement a checksum or some other means to verify that the contents conform to that.
Do you mean using a security hash key or something so that you will know if the file has been tampered with?
I believe md5 is a widely used hash function. Googling md5 and java yields quite a few results like the one below.
http://www.twmacinta.com/myjava/fast_md5.php
Create a checksum
Examples at http://www.rgagnon.com/javadetails/java-0416.html
--
http://www.rgagnon.com/howto.html
> Create a checksum
>
> Examples at
> http://www.rgagnon.com/javadetails/java-0416.html
Mr. Gagnon, is that you? I've used you as a reference numerous times. Thanks for sharing your work.
~
> Mr. Gagnon, is that you?
Yep
> I've used you as a reference
> numerous times. Thanks for sharing your work.
My pleasure.
Bye.
> Yep
> My pleasure.
> Bye.
brevity is the soul of wit. : )
i like your database how tos. they are very helpful.
Actully i am receiving these file from a remote machine... and on this i want to check file Integrity .
> Actully i am receiving these file from a remote
> machine... and on this i want to check file Integrity
.
Then you need to copy its checksum file as well.