@Test public void testHashValueOnlyZeroBits() throws Exception { assertThat(RandomString.hashOf(0).length(), not(0)); }
public static String hashOf(int value) { char[] buffer = new char[(Integer.SIZE / KEY_BITS) + ((Integer.SIZE % KEY_BITS) == 0 ? 0 : 1)]; for (int index = 0; index < buffer.length; index++) { buffer[index] = SYMBOL[(value >>> index * KEY_BITS) & (-1 >>> (Integer.SIZE - KEY_BITS))]; } return new String(buffer); }
RandomString { public static String hashOf(int value) { char[] buffer = new char[(Integer.SIZE / KEY_BITS) + ((Integer.SIZE % KEY_BITS) == 0 ? 0 : 1)]; for (int index = 0; index < buffer.length; index++) { buffer[index] = SYMBOL[(value >>> index * KEY_BITS) & (-1 >>> (Integer.SIZE - KEY_BITS))]; } return new String(buffer); } }
RandomString { public static String hashOf(int value) { char[] buffer = new char[(Integer.SIZE / KEY_BITS) + ((Integer.SIZE % KEY_BITS) == 0 ? 0 : 1)]; for (int index = 0; index < buffer.length; index++) { buffer[index] = SYMBOL[(value >>> index * KEY_BITS) & (-1 >>> (Integer.SIZE - KEY_BITS))]; } return new String(buffer); } RandomString();  RandomString(int length); }
RandomString { public static String hashOf(int value) { char[] buffer = new char[(Integer.SIZE / KEY_BITS) + ((Integer.SIZE % KEY_BITS) == 0 ? 0 : 1)]; for (int index = 0; index < buffer.length; index++) { buffer[index] = SYMBOL[(value >>> index * KEY_BITS) & (-1 >>> (Integer.SIZE - KEY_BITS))]; } return new String(buffer); } RandomString();  RandomString(int length); static String make(); static String make(int length); static String hashOf(int value); String nextString(); }
RandomString { public static String hashOf(int value) { char[] buffer = new char[(Integer.SIZE / KEY_BITS) + ((Integer.SIZE % KEY_BITS) == 0 ? 0 : 1)]; for (int index = 0; index < buffer.length; index++) { buffer[index] = SYMBOL[(value >>> index * KEY_BITS) & (-1 >>> (Integer.SIZE - KEY_BITS))]; } return new String(buffer); } RandomString();  RandomString(int length); static String make(); static String make(int length); static String hashOf(int value); String nextString(); static final int DEFAULT_LENGTH; }