Skip to content

Instantly share code, notes, and snippets.

@equipter
Created July 19, 2022 00:22
Show Gist options
  • Save equipter/203da8d0088e36ef6d90e9c28d36ab25 to your computer and use it in GitHub Desktop.
Save equipter/203da8d0088e36ef6d90e9c28d36ab25 to your computer and use it in GitHub Desktop.
How to xor uids for bcc

Calculating BCC by xoring

BCC calc in simplicity is just xoring the uid byte by byte starting from 0, and using the outputted xor from the first byte for the second byte so on and so forth

xor-ing is lining up the binary and if the number above and below are the same, value is 0 and if theyre different its 1

0000 0000
0000 0001 = 01
0000 0001 XOR = 0000 0001 = 01

0000 0001
0000 0010 = 02
0000 0011 XOR = 0000 0011 = 02

0000 0011
0000 0011 = 03
0000 0000 XOR = 0000 0000 = 00

0000 0000
0000 0100 = 04
0000 0100 XOR = 0000 0000 =4

bcc = 04 for UID of 01020304

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment