2025-09-17 12:16:15 +01:00
|
|
|
package moe.nekojimi.friendcloud;
|
|
|
|
|
|
|
|
import java.nio.ByteBuffer;
|
|
|
|
import java.nio.LongBuffer;
|
|
|
|
|
|
|
|
public class Util
|
|
|
|
{
|
|
|
|
public static long xorBytesToLong(byte[] bytes)
|
|
|
|
{
|
|
|
|
ByteBuffer buf = ByteBuffer.wrap(bytes);
|
|
|
|
LongBuffer longs = buf.asLongBuffer();
|
|
|
|
long ret = 0xBEEFCAFEF00DBABEL;
|
|
|
|
for (long l: longs.array())
|
|
|
|
{
|
|
|
|
ret = ret ^ l;
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
2025-09-18 11:01:12 +01:00
|
|
|
|
2025-09-17 12:16:15 +01:00
|
|
|
}
|