Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Is there a Java CRC/checksum command?

Options
  • 24-05-2001 1:26pm
    #1
    Registered Users Posts: 21,264 ✭✭✭✭


    I want to create a checksum on a file. Just wondering if there is a command in Java to do this or do I have to write my own?

    I see there is a command in java.util.zip (CheckedInputStream using Adler32) but I can't seem to get it to work properly :/

    Even tried this example. As usual I must be doing something wrong. frown.gif



Comments

  • Moderators, Music Moderators Posts: 1,481 Mod ✭✭✭✭satchmo


    Have you tried java.util.zip.CRC32?
    Will that example just not run, or does it give incorrect checksums, or what's the problem?


  • Registered Users Posts: 332 ✭✭spod


    javax.crypto is also well worth checking out.

    has md5 etc. hashing.

    haven't used it in a year, but cryptix used to have a good export friendly implementation of alot of the library.

    Licensing might be slightly more non us friendly for the official sun product now.

    spd


  • Registered Users Posts: 21,264 ✭✭✭✭Hobbes


    Thanks Spod. biggrin.gif Eventually found that (well java.security.* actually) and I'm using the digestinputstream to create the checksum.

    Appears to be working quite well.



    [This message has been edited by Hobbes (edited 29-05-2001).]


Advertisement