Generating Checksum on Windows
I got an interesting request from one of the enterprises which uses vijava in their product. Although there are downloads for binary and source packages on the sourceforge Web site, they still would like me to create the checksum as I am the trustable source for that. As I was told, the checksum is required by their build team. I don’t know how is exactly used, but I decided to help out anyway.
As I mainly use Windows for my own development, I searched for a tool that can generate the checksum. With no surprise, I found one from Microsoft. Its official name is called File Checksum Integrity Verifier (FCIV) utility. It does not come with GUI, but strictly command line which is good enough for me to generate the checksums. On high level, the FCIV:
- Supports MD5 or SHA1 hash algorithms (The default is MD5.)
- Can output hash values to the console or store the hash value and file name in an XML file
- Can recursively generate hash values for all files in a directory and in all subdirectories (for example, fciv.exe c:\ -r)
- Supplies an exception list to specify files or directories to hash
- Can store hash values for a file with or without the full path of the file
There are a few options for the command line which I won’t go through here. To save my time, I just create an XML file with both MD5 and SHA1 hashes.
Here is the command line I used to create the checksums for the vijava API 5.1:
C:\Temp\MS_checkSum>fciv.exe vijava5120121125.zip -both -xml vijava51.xml
The XML generated is as follows:
<?xml version="1.0" encoding="UTF-8"?> <FCIV> <FILE_ENTRY> <name>c:\users\jins3\downloads\vijava5120121125.zip</name> <MD5>VzbCTl9TtbEVs6eGXhq+Cg==</MD5> <SHA1>YqR8SZAR7yAKPHM4YKQJMRYmnbE=</SHA1> </FILE_ENTRY> </FCIV>
If you have to use checksum on Windows in the future, the FCIV utility is the way to go. As a command line, it should be easy to be integrated in your build system as well.