// Copyright 1997 The Open Group Research Institute.  All rights reserved.

package krb5.lib.crypto;

//XXX this should be a truely random, but non-repeating,
//integer value; however, implementations typically use the
//current time, as we do here

public class Nonce {
	private static int lastNonce;

	public static synchronized int value() {
		int temp = (int)(System.currentTimeMillis() / 1000);
		if (temp <= lastNonce)
			lastNonce++;
		else
		    lastNonce = temp;
		return lastNonce;
	}

}

