Skip to content

Instantly share code, notes, and snippets.

@rtoal
Created March 30, 2014 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rtoal/9876084 to your computer and use it in GitHub Desktop.
Save rtoal/9876084 to your computer and use it in GitHub Desktop.
Something I found and cleaned up a little bit
import java.util.Random;
public class Mystery {
public static void main(String[] args) {
System.out.println(randomString(-229985452) + " " + randomString(-147909649));
}
private static String randomString(int code) {
Random random = new Random(code);
StringBuilder builder = new StringBuilder();
while (true) {
int c = random.nextInt(27);
if (c == 0) break;
builder.append((char)('`' + c));
}
return builder.toString();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment