Skip to content
This repository has been archived by the owner on Jun 19, 2021. It is now read-only.

Commit

Permalink
More better random
Browse files Browse the repository at this point in the history
  • Loading branch information
duplexsystem committed Feb 9, 2021
1 parent 8acfd42 commit ae4cb2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/yatopiamc/bot/captcha/YatoCaptcha.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ private static InputStream generateImage(User u) {
Graphics2D g = (Graphics2D) image.getGraphics();
g.setFont(Font.createFont(Font.TRUETYPE_FONT, Objects.requireNonNull(ClassLoader.getSystemClassLoader().getResourceAsStream("LoveBaby.ttf"))).deriveFont(40f));
AffineTransform at = new AffineTransform();
at.setToRotation(Math.random());
at.setToRotation(ThreadLocalRandom.current().nextInt(0, 360));
g.setTransform(at);
g.drawString(code, 50, 50);
g.drawString(code, ThreadLocalRandom.current().nextInt(25,75), ThreadLocalRandom.current().nextInt(25,75));
g.dispose();

ByteArrayOutputStream os = new ByteArrayOutputStream();
Expand Down

0 comments on commit ae4cb2c

Please sign in to comment.