Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static byte[] getXOR(byte[] data) {
- byte[] xorBytes = new byte[2];
- int s1 = 0;
- int s2 = 0;
- for (byte b : data) {
- s1 = (s1 ^ b);
- s2 = Integer.rotateRight(s2, 1) ^ b;
- }
- xorBytes[0] = (byte) (s1);
- xorBytes[1] = (byte) (s2);
- return xorBytes;
- }
Advertisement
Add Comment
Please, Sign In to add comment