diff --git a/GameServer/src/org/moparscape/msc/gs/tools/DataConversions.java b/GameServer/src/org/moparscape/msc/gs/tools/DataConversions.java index 1e8cffe..a8c30ca 100644 --- a/GameServer/src/org/moparscape/msc/gs/tools/DataConversions.java +++ b/GameServer/src/org/moparscape/msc/gs/tools/DataConversions.java @@ -12,7 +12,6 @@ import java.util.Random; import org.moparscape.msc.gs.connection.RSCPacket; import org.moparscape.msc.gs.core.GameEngine; import org.moparscape.msc.gs.model.Point; -import org.moparscape.msc.gs.util.HexString; import org.moparscape.msc.gs.util.Logger; public final class DataConversions { @@ -258,9 +257,16 @@ public final class DataConversions { * returns the md5 hash of a string */ public static String md5(String s) { - md.reset(); - md.update(s.getBytes()); - return new HexString(md.digest()).toString(); + synchronized (md){ + md.reset(); + md.update(s.getBytes()); + return toHex(md.digest()); + } + } + + public static String toHex(byte[] bytes) { + // change below to lower or uppercase X to control case of output + return String.format("%0" + (bytes.length << 1) + "x", new BigInteger(1, bytes)); } /** diff --git a/GameServer/src/org/moparscape/msc/gs/util/HexString.scala b/GameServer/src/org/moparscape/msc/gs/util/HexString.scala deleted file mode 100644 index 6b73e25..0000000 --- a/GameServer/src/org/moparscape/msc/gs/util/HexString.scala +++ /dev/null @@ -1,7 +0,0 @@ -package org.moparscape.msc.gs.util - -class HexString(bytes: Array[Byte]) { - lazy val string = bytes.map(0xFF & _).map { "%02x".format(_) }.foldLeft("") { _ + _ } - - override def toString = string -} \ No newline at end of file diff --git a/LoginServer/lib/hex-string.jar b/LoginServer/lib/hex-string.jar deleted file mode 100644 index 477c6cc..0000000 Binary files a/LoginServer/lib/hex-string.jar and /dev/null differ