Java Random randomKey()

Here you can find the source of randomKey()

Description

random Key

License

Open Source License

Declaration

public final static String randomKey() 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public final static String randomKey() {
        byte[] key = new byte[16];
        for (int i = 0; i < 16; i++) {
            key[i] = (byte) (-128 + (int) (Math.random() * ((127 - -128) + 1)));
        }/*from w ww .  j  ava2  s  . c  om*/
        return new String(key);
    }
}

Related

  1. randomIntArray(int len, Random rand)
  2. randomIntegerList(int sz, int min, int max)
  3. randomIntegers(int sz)
  4. randomIterable(Collection col)
  5. randomKey()
  6. randomLetter()
  7. randomList(Collection collection)
  8. randomMember(Collection collection)
  9. randomNanoTime()