Read Card ID tool

Example of how to get the Card ID using the API

Enter raw card Data:  
Number trailing Parity bits to strip:  
Number of bits in FAC:  
Number of bits in ID:  
Select Language:  



FAC=9, ID=6699


Example Code to extract FAC & ID

using System;

//C# example
   byte[] idBuf = new byte[32];
   int idRaw = 0;
   int id = 0;
   int fac = 0;
   int B = 8; //or Set B=32 for large card IDs
   short bits = 0;
   if(B == 32)
   {
       bits = RFIDeas_pcProxAPI.pcProxDLLAPI.getActiveID32(32);
   }
   else
   {
       bits = RFIDeas_pcProxAPI.pcProxDLLAPI.getActiveID(8);
   }
   for(short z=0; z<B; z++)
   {
       idBuf[(B-1)-z]=RFIDeas_pcProxAPI.pcProxDLLAPI.getActiveID_byte(z);
   }
   if(bits > 0)
   {
       // Convert BYTE array to long [0]= MSB..[n]=LSB
       for(int i = 0; i<(bits+7)/8; i++)
       {
           idRaw = (idRaw<<8) | idBuf[i];
       }
       id = idRaw>>1; // Remove Trailing parity
       id = (int)(idRaw & 0x0ffffL);
       fac = id>>17;
       fac &= 0x0ff;
       Console.Write("Card Bits={0:D},FAC={1:D},ID={2:D}\n",bits,fac,id);
   }

Note: Most cards can be read with GetActiveID() function as this returns 8 bytes for up to 64 bits of card data. Certain readers such as Legic, Indala, HID™ long, have ID's longer than 64 bits. For these cards use GetActiveID32() which returns up to 255 bits of card data. The GetActiveID32 function is not available on the device firmware where it is not required.