You don't need to allocate this memory here ...
> int amountread;
> byte[] buffer = new byte[1024];
> md.reset();
> try
> {
> FileInputStream fis = new FileInputStream( filename );
> while( ( amountread = fis.read( buffer ) ) != -1 )
> {
> md.update( buffer );
Consider what happens if only three bytes are read ... you're
digesting lots of bytes that should be ignored.
> }
> temp = md.digest();
> System.out.println( " " + temp );
You should probably conver the number to a BigInteger and
then print it in hex.
> System.out.println( " " + md.getDigestLength() );
> fis.close();
>
> My output consists of an eleven digit number. The message digest
> between runs also changes. Any help would be much appreciated.
Try fixing the bugs noted above, and see how much that helps.
- Dave
> Scott