Get multiplayer working

This commit is contained in:
zontreck 2023-12-06 10:01:40 -07:00
parent 121075336f
commit e193be5cd3

View file

@ -1,5 +1,7 @@
package com.mojang.minecraft.server;
import dev.zontreck.ariaslib.util.Hashing;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
@ -11,14 +13,7 @@ public final class MPPassCalculator {
this.salt = var1;
}
public final String calcMPass(String var1) {
try {
String var3 = this.salt + var1;
MessageDigest var4 = MessageDigest.getInstance("MD5");
var4.update(var3.getBytes(), 0, var3.length());
return (new BigInteger(1, var4.digest())).toString(16);
} catch (NoSuchAlgorithmException var2) {
throw new RuntimeException(var2);
}
public final String calcMPass(String username) {
return Hashing.md5(this.salt + username);
}
}