public static final char randomReadableChar(Random rand) {
    int i = rand.nextInt(26 * 2 + 10 + 1);
    if (i < 26) return (char) ('A' + i);
    i -= 26;

    if (i < 26) return (char) ('a' + i);
    i -= 26;

    if (i < 10) return (char) ('0' + i);
    i -= 10;

    assert i == 0;
    return '_';
  }
These helper methods generate random byte[]'s data for KeyValues
hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/RandomKeyValueUtil.java