public static byte[] randomFixedLengthValue(Random rand, int valueLength) {
    StringBuilder v = new StringBuilder();
    for (int j = 0; j < valueLength; ++j) {
      v.append((char) (32 + rand.nextInt(95)));
    }

    byte[] valueBytes = Bytes.toBytes(v.toString());
    return valueBytes;
  }
Generates a random key that is guaranteed to increase as the given index i increases. The
result consists of a prefix, which is a deterministic increasing function of i, and a random
suffix.
@param rand random number generator to use
@return the random key
hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/RandomKeyValueUtil.java