4

I need to compute an ANSI CRC-­16 hash of plainText ASCII bytes using the standard ANSI CRC‐16 hash with the polynomial of X16 + X15 + X2 + 1.

For example, if I have plaintext of 1085051000201146587443HG234, I need to be able to generate the CRC-­‐16 Hash, which in this case would be 26359.

It looks like a two-step process to me, where the first step would be to convert each letter/integer into an ASCII value and append all the values together.

The second step would be to take that numeric string and apply the polynomial calculation.

Any ideas how to do this in Javascript? Is this possible?

scottdevries
  • 117
  • 2
  • 7
  • Yes, it's possible. What reference did you start with, and what have you tried? The only "odd stuff" is a little bit of masking work to account for how numbers in JavaScript work. –  Dec 12 '11 at 19:36
  • To be honest, I haven't really worked with polynomials or hashes before. Bit of a noob and don't know where to begin. Sorry! That didn't give you much to work with. – scottdevries Dec 12 '11 at 19:50

1 Answers1

3

There's an example here: http://zorc.breitbandkatze.de/crc.html

Dagg Nabbit
  • 75,346
  • 19
  • 113
  • 141