aspose file tools*
The moose likes Java in General and the fly likes CRC16 with Polynominal : 0x8408, and Preset CRC : 0x6363 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "CRC16 with Polynominal : 0x8408, and Preset CRC : 0x6363" Watch "CRC16 with Polynominal : 0x8408, and Preset CRC : 0x6363" New topic
Author

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

Leonardo Carreira
Ranch Hand

Joined: Apr 07, 2009
Posts: 489

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..


Sorry, perhaps my english language isn't too good.. Prepare for SCJP 6, Please God help me.. ☼
References : [Java.Boot] [JavaChamp] [JavaPrepare]
Martin Vanyavchich
Ranch Hand

Joined: Sep 16, 2008
Posts: 241
Try searching the forum for CRC or CRC16, there have been some threads on this topic already.


SCJP 6, OCMJD 6, OCPJWSD 6
I no good English.
Leonardo Carreira
Ranch Hand

Joined: Apr 07, 2009
Posts: 489

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

Joined: Oct 27, 2005
Posts: 19697
    
  20

is nothing more than Python's way of writing The other operators are available in Java as well.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Leonardo Carreira
Ranch Hand

Joined: Apr 07, 2009
Posts: 489

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

Joined: Oct 27, 2005
Posts: 19697
    
  20

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: CRC16 with Polynominal : 0x8408, and Preset CRC : 0x6363