org.apache.catalina.tribes.util

Class UUIDGenerator

public class UUIDGenerator extends Object

simple generation of a UUID

Version: 1.0

Author: Filip Hanik

Field Summary
static intBITS_PER_BYTE
static intBYTES_PER_INT
protected static Randomrand
protected static SecureRandomsecrand
static intUUID_LENGTH
static intUUID_VERSION
Method Summary
static voidnextBytes(byte[] into, int offset, int length, Random r)
Same as java.util.Random.nextBytes except this one we dont have to allocate a new byte array
static byte[]randomUUID(boolean secure)
static byte[]randomUUID(boolean secure, byte[] into, int offset)

Field Detail

BITS_PER_BYTE

public static final int BITS_PER_BYTE

BYTES_PER_INT

public static final int BYTES_PER_INT

rand

protected static Random rand

secrand

protected static SecureRandom secrand

UUID_LENGTH

public static final int UUID_LENGTH

UUID_VERSION

public static final int UUID_VERSION

Method Detail

nextBytes

public static void nextBytes(byte[] into, int offset, int length, Random r)
Same as java.util.Random.nextBytes except this one we dont have to allocate a new byte array

Parameters: into byte[] offset int length int r Random

randomUUID

public static byte[] randomUUID(boolean secure)

randomUUID

public static byte[] randomUUID(boolean secure, byte[] into, int offset)
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.