mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-22 14:23:50 -07:00
chg: crc16 got a compute_crc function
This commit is contained in:
parent
eb8e7a1679
commit
bf25b1c9ba
6 changed files with 41 additions and 10 deletions
|
@ -277,16 +277,17 @@ int CmdAnalyseCRC(const char *Cmd) {
|
|||
}
|
||||
len >>= 1;
|
||||
|
||||
PrintAndLog("\nTests with | %s", sprint_hex(data, len));
|
||||
|
||||
PrintAndLog("\nTests with (%d) | %s",len, sprint_hex(data, len));
|
||||
|
||||
init_table(CRC_LEGIC);
|
||||
// 51 f5 7a d6
|
||||
uint8_t uid[] = {0x51, 0xf5, 0x7a, 0xd6}; //12 34 56
|
||||
init_table(CRC_LEGIC);
|
||||
uint8_t legic8 = CRC8Legic(uid, sizeof(uid));
|
||||
PrintAndLog("LEGIC | %X (EF6F expected) %02x", crc16_legic(data, sizeof(len), legic8), legic8);
|
||||
|
||||
PrintAndLog("Legic 16 | %X (EF6F expected) [legic8 = %02x]", crc16_legic(data, len, legic8), legic8);
|
||||
init_table(CRC_FELICA);
|
||||
PrintAndLog("FeliCa | %X ", crc16_xmodem(data, len));
|
||||
|
||||
return 0;
|
||||
PrintAndLog("\nTests of reflection. Current methods in source code");
|
||||
PrintAndLog(" reflect(0x3e23L,3) is %04X == 0x3e26", reflect(0x3e23L,3) );
|
||||
PrintAndLog(" reflect8(0x80) is %02X == 0x01", reflect8(0x80));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue