Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Is there a Java CRC/checksum command?

  • 24-05-2001 01:26PM
    #1
    Registered Users, Registered Users 2 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

  • Registered Users, Registered Users 2 Posts: 1,481 ✭✭✭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, Registered Users 2 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, Registered Users 2 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
Advertisement