gnu.crypto.util

Class PRNG

public class PRNG extends Object

A useful Singleton hash-based (SHA) pseudo-random number generator used throughout this library.

Version: $Revision: 1.5 $

See Also: MDGenerator

Method Summary
static voidnextBytes(byte[] buffer)

Completely fills the designated buffer with random data generated by the underlying singleton.

static voidnextBytes(byte[] buffer, int offset, int length)

Fills the designated buffer, starting from byte at position offset with, at most, length bytes of random data generated by the underlying singleton.

Method Detail

nextBytes

public static void nextBytes(byte[] buffer)

Completely fills the designated buffer with random data generated by the underlying singleton.

Parameters: buffer the place holder of random bytes generated by this PRNG singleton. On output, the contents of buffer are replaced with pseudo-random data, iff the buffer size is not zero.

nextBytes

public static void nextBytes(byte[] buffer, int offset, int length)

Fills the designated buffer, starting from byte at position offset with, at most, length bytes of random data generated by the underlying singleton.

See Also: IRandom

Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.