mirror of
https://github.com/LamGC/ScalaBot.git
synced 2025-07-16 12:17:23 +00:00
fix: 修正了数据库命名错误的问题.
由于 MessageDigest 不适用于多线程环境, 导致用于创建数据库名称的数据会不断累加, 最终出现 botToken 无法对应数据库的问题.
This commit is contained in:
@ -8,7 +8,8 @@ final class ByteUtils {
|
||||
public static String bytesToHexString(byte[] bytes) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (byte aByte : bytes) {
|
||||
builder.append(Integer.toHexString(aByte));
|
||||
String hexBit = Integer.toHexString(aByte & 0xFF);
|
||||
builder.append(hexBit.length() == 1 ? "0" + hexBit : hexBit);
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
Reference in New Issue
Block a user