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

Calculating CRC 16 in java

 
polo rao
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi , i need to do a project which wants me to calculate CRC 16 in java without using lookup table
Can anybody guide me about how we code for CRC16 in java
I know Java has CRC32 package but i dont see how it can help me

Thanks in advance
 
polo rao
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone please help me. I was really pissed off , trying to figure out how to do it all night.and i have to submit my code by monday
Any help will be appreciated
Thanks
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you have so far? Do you understand the algorithm for CRC in general? If so, what stops you from implementing it? If not, do you have material that explains it?
 
Rob Spoor
Sheriff
Pie
Posts: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would have said to check the source of CRC32, but its important methods are native.

Using Google, I found two results you may be able to use. The first one uses a lookup table though, but the seecond one surely does not.
 
polo rao
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rob for your reply.
I wanted to know , in the 2nd link

Isnt this line initialising a generator polynomial , to create a lookup table in program.
I dont know if it really does , but was just puzzled about what is its use in program
Thanks

 
Henry Wong
author
Marshal
Pie
Posts: 21117
78
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Isnt this line initialising a generator polynomial , to create a lookup table in program.
I dont know if it really does , but was just puzzled about what is its use in program


The reason lookup tables are *not* allowed in a homework assignment is because it is possible to develop the CRC code without knowing how CRC works. And the purpose of the assignment is to learn how CRC works.

Anyway, do you know how CRC works? If you don't, I recommend that you do that first -- coding by cut and paste may get you done with the assignment, but you don't really learn much.

Henry
 
sindhu sheela
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the second one (the second mentioned href)uses a package "javazoom.jl.decoder" can i know which jar file/required library is it?
i need to implement the below
CRC-16 modbus (Polynomial =
0xA001 ( initialize data is 0xffff) check sum.

thanks in advance
 
Rob Spoor
Sheriff
Pie
Posts: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javazoom.jl.decoder
The first hit gives you the Javadocs of the library. From that you should be able to find a download link.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic