 # 12 digit unique number help me

how to find 12 digit unique number

rfid card number is :-0009008413 137,29981

first thanks for help me ,but i want to 12 digit number for add in coding

bec its contain 12 digit number

saggy22:
how to find 12 digit unique number
rfid card number is :-0009008413 137,29981

Got to your local games store, and tell them you want a ‘d20’. They will sell you an icosahedral dice for 2 or three bucks. Then roll it 12 times, ignoring the ‘tens’ digit. This will give you a 12 digit number which is very likely to be unique.

I belive Arduino supports a 64-bit ‘long long’ type. This has sufficient bits to hold a 12-digit number.

You are going to do a whole lot better job of explaining what you want and what you have tried so far if you expect people to help you.

in that i want to 12 digit number for my rfid card like bellow link https://alselectro.wordpress.com/tag/em18-rfid/

because i this i dont know starting byte

in that i want to 12 digit number for my rfid card like bellow link https://alselectro.wordpress.com/tag/em18-rfid/

I don't understand. The link mentions the 10digit and 8digit numbers from the RFID card. What's 12 got to do with anything? Presumably you could take the 10digit number and add two digits from the 8digit number...

...or add four and subtract two.

thanks westfw , morgans

but in that i cant understand how to convert that 18 digit card number to 12 digit number.

that 12 digit number is UART number for coding, so i want 12 digit number

1) 10 is the start*byte; according to the description it is manufacturer dependent 2) 0069656E is the card ID (4 **bytes) 3) 72 is the checksum (1 **byte*)

All numbers above are expressed as hexadecimal values.

The total is 6 bytes, not 12. The text representation of this number is 12 characters.

If you do not know the start number, you can not create an ID; with brute force you can try the 256 combinations.

The below is sample code how to calculate

``````// structure based on the providde link
struct RFIDTAGDATA
{
byte startbyte;
long tagnumber;
byte xor;
};

RFIDTAGDATA rfid;

void setup()
{
char textbuffer;

Serial.begin(9600);

// start byte
rfid.startbyte = 16;
// unique tag number
rfid.tagnumber = 6907246;

// xor
rfid.xor = rfid.startbyte;
rfid.xor ^= rfid.tagnumber>>24 & 0xFF;
rfid.xor ^= rfid.tagnumber>>16 & 0xFF;
rfid.xor ^= rfid.tagnumber>>8 & 0xFF;
rfid.xor ^= rfid.tagnumber & 0xFF;

sprintf(textbuffer,"%02X %08X %02X (%d)", rfid.startbyte, rfid.tagnumber, rfid.xor, rfid.xor);
Serial.println(textbuffer);
}
``````

The code uses a struct to create a 'logical unit' for the RFID data. In setup, the code sets the startbyte and the tagnumber (both are based on the exxample in the link you provided). Next it calculates the xor value.

The sprintf is used to place the data in a character array and next the data is send over the serial connection.

I don't know much about RFID; you might have to change the type of the tagnumber to unsigned long (I doubt there are negative tag numbers ;)

saggy22:
how to find 12 digit unique number
rfid card number is :-0009008413 137,29981