cryptix.pgp
Class CRC

java.lang.Object
  |
  +--cryptix.pgp.CRC

public class CRC
extends java.lang.Object

This class calculates the CRC check as required by PGP base64 encoded packets.

Copyright © 1995-1997 Systemics Ltd on behalf of the Cryptix Development Team.
All rights reserved.

$Revision: 1.1.1.1 $

Since:
Cryptix 2.2 or earlier
Author:
unattributed

Field Summary
static int ACCUM_INIT
           
 
Constructor Summary
CRC()
           
 
Method Summary
 void add(byte[] buf)
          Adds the contents of the buffer to the CRC.
static int checksum(byte[] buf)
           
static int checksum(int accum, byte[] buf)
           
 int crc()
          Returns the current value of the CRC.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACCUM_INIT

public static final int ACCUM_INIT
Constructor Detail

CRC

public CRC()
Method Detail

checksum

public static int checksum(byte[] buf)

checksum

public static int checksum(int accum,
                           byte[] buf)

add

public final void add(byte[] buf)
Adds the contents of the buffer to the CRC.
Parameters:
buf - the buffer to add.

crc

public final int crc()
Returns the current value of the CRC.
Returns:
the CRC value so far.