From 2dd7443d4c3b4f2a8d865e6c95fc248d722a7b4b Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+chomens@users.noreply.github.com> Date: Mon, 21 Oct 2024 13:38:57 +0700 Subject: [PATCH] Update SBot hashing --- .../chipmunk/chipmunkmod/util/BotValidationUtilities.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/land/chipmunk/chipmunkmod/util/BotValidationUtilities.java b/src/main/java/land/chipmunk/chipmunkmod/util/BotValidationUtilities.java index 808cca7..aa79138 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/util/BotValidationUtilities.java +++ b/src/main/java/land/chipmunk/chipmunkmod/util/BotValidationUtilities.java @@ -52,9 +52,9 @@ public class BotValidationUtilities { if (key == null) throw new RuntimeException("The key of the bot is unspecified (null), did you incorrectly add it to your config?"); try { - MessageDigest md = MessageDigest.getInstance("SHA-256"); + MessageDigest md = MessageDigest.getInstance("MD5"); String time = String.valueOf(System.currentTimeMillis() / 20000); - String input = prefix + command.replaceAll("&[0-9a-fklmnorx]", "") + ";" + client.player.getName() + ";" + time + ";" + key; + String input = prefix + command.replaceAll("&[0-9a-fklmnorx]", "") + ";" + client.player.getName().getString() + ";" + time + ";" + key; byte[] hash = md.digest(input.getBytes(StandardCharsets.UTF_8)); BigInteger bigInt = new BigInteger(1, Arrays.copyOfRange(hash, 0, 4)); String stringHash = bigInt.toString(Character.MAX_RADIX);