mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-05-26 22:10:48 +08:00
Add Dispatch Password authentication
This commit is contained in:
committed by
Luke H-W
Unverified
parent
42e3af4e39
commit
bc2c5deb48
@@ -0,0 +1,24 @@
|
||||
package emu.grasscutter.utils;
|
||||
|
||||
public class ByteHelper {
|
||||
public static byte[] changeBytes(byte[] a) {
|
||||
byte[] b = new byte[a.length];
|
||||
for (int i = 0; i < a.length; i++) {
|
||||
b[i] = a[a.length - i - 1];
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
public static byte[] longToBytes(long x) {
|
||||
byte[] bytes = new byte[8];
|
||||
bytes[0] = (byte) (x >> 56);
|
||||
bytes[1] = (byte) (x >> 48);
|
||||
bytes[2] = (byte) (x >> 40);
|
||||
bytes[3] = (byte) (x >> 32);
|
||||
bytes[4] = (byte) (x >> 24);
|
||||
bytes[5] = (byte) (x >> 16);
|
||||
bytes[6] = (byte) (x >> 8);
|
||||
bytes[7] = (byte) (x);
|
||||
return bytes;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user