mirror of
https://github.com/LamGC/ScalaBot.git
synced 2025-04-29 22:27:31 +00:00
18 lines
429 B
Java
18 lines
429 B
Java
package net.lamgc.scalabot.util;
|
|
|
|
final class ByteUtils {
|
|
|
|
private ByteUtils() {
|
|
}
|
|
|
|
public static String bytesToHexString(byte[] bytes) {
|
|
StringBuilder builder = new StringBuilder();
|
|
for (byte aByte : bytes) {
|
|
String hexBit = Integer.toHexString(aByte & 0xFF);
|
|
builder.append(hexBit.length() == 1 ? "0" + hexBit : hexBit);
|
|
}
|
|
return builder.toString();
|
|
}
|
|
|
|
}
|