Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CRC16 with Polynominal : 0x8408, and Preset CRC : 0x6363

 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends..

Currently i'm looking for maybe there's existing CRC16 java class which compute CRC16 with Polynominal : 0x8408, and Preset CRC : 0x6363..
But if there's no existing CRC16 java class, please help me how to create a Java class which compute CRC16 with Polynominal : 0x8408, and Preset CRC : 0x6363..

i have tried using this CRC16 classes of this LINK, but it's not what i need..

Please help me regarding this..

Any help would be appreciated..

Thanks in advance..
 
Martin Vanyavchich
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try searching the forum for CRC or CRC16, there have been some threads on this topic already.
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Martin,

Thanks for your reply..
I've looked up it on google and i found that actually the CRC16 that i'm looking for is CRC16 according to ISO14443A..
I've found that implementation in Phyton..
But, i face problem how to implement it in Java..

Here's the implementation of CRC16 in Phyton :


Could you or anyone help me to convert this in Java method..
Sorry, i'm a little bit stuck to implement this in Java, especially for this line of codes :


Please help me, Any help would be very appreciated..

Thanks
 
Rob Spoor
Sheriff
Pie
Posts: 20531
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is nothing more than Python's way of writing The other operators are available in Java as well.
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rob Prime,

Thanks for your reply..
Hmm, sorry i'm not too understand how to use any unsigned data type (same as used by C) in Java..
Could you or anyone help me how to convert these methods in Java?..
Sorry, i'm stuck.. This code seems a little bit complicated to translated into Java..



Thanks in advance..
Any help would be very appreciated..
 
Rob Spoor
Sheriff
Pie
Posts: 20531
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think you need to have them unsigned. An unsigned short with value 0x8408 will be transformed into a signed short with value -31736. However, because both are 16 bit numbers, they both still have the same bit pattern. Since all your >>, & and ^ operators work on bit patterns (not numbers) you will end up with the same bit pattern again. Your signed short will be recognized as the correct unsigned short in a C program.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic