JXTA

jxta.security.impl.random
Class JRandom

java.lang.Object
  |
  +--java.util.Random
        |
        +--jxta.security.impl.random.JRandom

public class JRandom
extends java.util.Random

See Also:
Serialized Form

Constructor Summary
JRandom()
          Required constructors
JRandom(long lseed)
           
 
Method Summary
 void generateData(byte[] buffer, int offset, int length)
          generate requested bytes of random data See "Applied Cryptograpy" on "Distilling Randomness." We use SHA-1 rather than MD5.
protected  int next(int bits)
          some bits of an int
 void nextBytes(byte[] buff)
          generate buff.length random bytes
 int nextInt()
           
 long nextLong()
           
 void setSeed(byte[] buffer, int offset, int length)
          override our default seed
 void setSeed(long lseed)
          Random class methods
 java.lang.String whoami()
          An identifier
 
Methods inherited from class java.util.Random
nextBoolean, nextDouble, nextFloat, nextGaussian, nextInt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JRandom

public JRandom()
        throws jxta.security.exceptions.CryptoException
Required constructors

JRandom

public JRandom(long lseed)
        throws jxta.security.exceptions.CryptoException
Method Detail

whoami

public java.lang.String whoami()
An identifier

generateData

public void generateData(byte[] buffer,
                         int offset,
                         int length)
generate requested bytes of random data See "Applied Cryptograpy" on "Distilling Randomness." We use SHA-1 rather than MD5.

setSeed

public void setSeed(byte[] buffer,
                    int offset,
                    int length)
override our default seed

setSeed

public void setSeed(long lseed)
Random class methods
Overrides:
setSeed in class java.util.Random

next

protected int next(int bits)
some bits of an int
Overrides:
next in class java.util.Random

nextBytes

public void nextBytes(byte[] buff)
generate buff.length random bytes
Overrides:
nextBytes in class java.util.Random

nextInt

public int nextInt()
Overrides:
nextInt in class java.util.Random

nextLong

public long nextLong()
Overrides:
nextLong in class java.util.Random

JXTA