src/douran/service/UUID.java
public static String uuid(int len, int radix) {
        if (radix > CHARS.length) {
            throw new IllegalArgumentException();
        }
        char[] uuid = new char[len];
        // Compact form
        for (int i = 0; i < len; i++) {
            uuid[i] = CHARS[(int)(Math.random()*radix)];
        }
        return new String(uuid);
    }
/**
     * Generate a random uuid of the specified length, and radix. Examples:
     * <ul>
     * <li>uuid(8, 2) returns "01001010" (8 character ID, base=2)
     * <li>uuid(8, 10) returns "47473046" (8 character ID, base=10)
     * <li>uuid(8, 16) returns "098F4D35" (8 character ID, base=16)
     * </ul>
     *
     * @param len
     *            the desired number of characters
     * @param radix
     *            the number of allowable values for each character (must be <=
     *            62)
     */
Generate a random uuid of the specified length, and radix.

@param len
the desired number of characters
@param radix
the number of allowable values for each character (must be <
62)
Generate a random uuid of the specified length and radix . @param len the desired number of characters @param radix the number of allowable values for each character ( must be < 62 )
public static String uuid(int len, int radix) {
        if (radix > CHARS.length) {
            throw new IllegalArgumentException();
        }
        char[] uuid = new char[len];
        for (int i = 0; i < len; i++) {
            uuid[i] = CHARS[(int)(Math.random()*radix)];
        }
        return new String(uuid);
    }
public static String uuid ( int len , int radix ) { if ( radix > CHARS . length ) { throw new IllegalArgumentException ( ) ; } char [ ] uuid = new char [ len ] ; for ( int i = 0 ; i < len ; i ++ ) { uuid [ i ] = CHARS [ ( int ) ( Math . random ( ) * radix ) ] ; } return new String ( uuid ) ; }
Generate a random uuid of the specified length, and radix.
Generate a random uuid of the specified length and radix .
// Compact form