package org.chabu;




public
class Random  {

    private long seed;

    private static final long multiplier = 0x5_DEEC_E66DL;
    private static final long addend     = 0x0BL;
    private static final long mask       = (1L << 48) - 1;

    public Random(long seed) {
        this.seed = initialScramble(seed);
    }

    private static long initialScramble(long seed) {
        return (seed ^ multiplier) & mask;
    }

    protected int next(int bits) {
        this.seed = (this.seed * multiplier + addend) & mask;
        return (int)(this.seed >>> (48 - bits));
    }

    public void nextBytes(byte[] bytes, int offset, int length ) {
        for (int i = 0; i < length; ) {
           	bytes[offset+i++] = (byte)nextInt();
        }
    }

    public int nextInt() {
        return next(32);
    }

}

@@ -19,22 +19,15 @@
 %0D%0A%0D%0A
-%0D%0A%0D%0A%0D%0A
 public
-%0D%0A
+ 
 clas
@@ -35,17 +35,16 @@
  Random 
- 
 %7B%0D%0A%0D%0A   
@@ -295,294 +295,34 @@
 d = 
-initialScramble(seed);%0D%0A    %7D%0D%0A%0D%0A    private static long initialScramble(long seed) %7B%0D%0A        return (seed %5E multiplier) & mask;%0D%0A    %7D%0D%0A%0D%0A    protected int next(int bits) %7B%0D%0A        this.seed = (this.seed * multiplier + addend) & mask;%0D%0A        return (int)(this.seed %3E%3E%3E (48 - bits))
+(seed %5E multiplier) & mask
 ;%0D%0A 
@@ -548,22 +548,100 @@
     
-return next(32
+this.seed = (this.seed * multiplier + addend) & mask;%0D%0A        return (int)(this.seed %3E%3E%3E 16
 );%0D%0A

Simplify random, so it can be port as easily as possible.