krishraghuram / mess

Mess Feedback System using RFID, Raspberry Pi and Django
GNU General Public License v2.0
0 stars 0 forks source link

Critical bug in UID #29

Closed krishraghuram closed 6 years ago

krishraghuram commented 6 years ago

UID is a 32 bit number.

It can be represented as 4 8bit decimal numbers, akin to dotted decimal representation of IP addresses. Eg : 229, 80, 20, 175 Currently, for some stupid reason, the four parts are concatenated and stored as string. Eg : 2298020175 This will lead to clashes. Eg : 229, 80, 201, 75

This is a CRITICAL issue.

FIX : Use hex notation. Each 8 bit part can be converted to 2 digit hex number. Thus, entire 32 bit uid will be a 8 digit hex number. This ensures uniqueness.