Java Checksum Calculate checksumLength(int algorithmCode, int dataLength)

Here you can find the source of checksumLength(int algorithmCode, int dataLength)

Description

checksum Length

License

Apache License

Declaration

public static int checksumLength(int algorithmCode, int dataLength) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public final static int NO_CHECKSUM = 0;
    private final static int CHECK_CHUNK_SIZE = 512;

    public static int checksumLength(int algorithmCode, int dataLength) {
        if (algorithmCode == NO_CHECKSUM) {
            return 0;
        } else {//from  w  ww. j  a  v a 2s .  c om
            return (int) Math.ceil((double) dataLength / CHECK_CHUNK_SIZE) * 8;
        }
    }
}

Related

  1. checksum(String filename)
  2. checksum(String nmea)
  3. checksum_icmpv6(byte pkt[])
  4. checksumBytesToString(byte[] digestBytes)
  5. checksumFile(File file)
  6. createChecksum(File file, String shaAlgo)
  7. generateChecksum(InputStream is)
  8. generateChecksum(String path, String flavor)
  9. generateChecksum(String pType, String pInFile)