// Copyright 1997 The Open Group Research Institute.  All rights reserved.

// test of crc32.java

import krb5.lib.crypto.crc32;

class crc32test {

	public static void main(String args[]) {
		crc32.printcrc32Table();
		System.out.println();

		//byte[] data = { (byte)0x01 };
		//byte[] data = { (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x80 };
		//byte[] data = { (byte)0x66, (byte)0x6f, (byte)0x6f };
		String s = "foo";
		byte[] data = new byte[s.length()];
		s.getBytes(0, s.length(), data, 0);
		int result;

		result = crc32.byte2crc32(data);
		System.out.println(result + " (" + Integer.toHexString(result)
			+ ")");
	}

}