All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class au.net.aba.crypto.provider.CRC16

java.lang.Object
   |
   +----java.security.MessageDigest
           |
           +----au.net.aba.crypto.provider.CRC16

public class CRC16
extends MessageDigest
A class that implements the CCITT CRC-16 checksumming algorithm, for the reflected polynomial 0x8408. Note: if you want to do a zero value check on some data and it's associated CRC, the CRC should be added after the data, least significant byte first.


Variable Index

 o ident

Constructor Index

 o CRC16()
This constructor is used to begin a new CRC-16 operation

Method Index

 o engineDigest()
return the CRC.
 o engineReset()
reset the CRC back to zero.
 o engineUpdate(byte)
update the CRC with a single byte.
 o engineUpdate(byte[], int, int)
update the CRC with an array of bytes.

Variables

 o ident
 public static final String ident

Constructors

 o CRC16
 public CRC16()
This constructor is used to begin a new CRC-16 operation

Methods

 o engineReset
 protected void engineReset()
reset the CRC back to zero.

Overrides:
engineReset in class MessageDigest
 o engineUpdate
 protected synchronized void engineUpdate(byte b)
update the CRC with a single byte.

Parameters:
b - the byte of input.
Overrides:
engineUpdate in class MessageDigest
 o engineUpdate
 protected synchronized void engineUpdate(byte bytes[],
                                          int offset,
                                          int length)
update the CRC with an array of bytes.

Parameters:
bytes - the input array.
offset - the offset to start getting bytes from.
length - the number of bytes to be processed.
Overrides:
engineUpdate in class MessageDigest
 o engineDigest
 protected synchronized byte[] engineDigest()
return the CRC. Note this resets it.

Returns:
the crc16 as a byte array.
Overrides:
engineDigest in class MessageDigest

All Packages  Class Hierarchy  This Package  Previous  Next  Index