File: vaxcrc.h

package info (click to toggle)
dnprogs 2.52
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,644 kB
  • ctags: 4,021
  • sloc: ansic: 26,737; cpp: 10,666; makefile: 832; sh: 537; awk: 13
file content (25 lines) | stat: -rw-r--r-- 682 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef _VAXCRC_H
#define _VAXCRC_H

#define DAPPOLY 	0xE905 // X^16+X^15+X^13+X^7+X^4+X^2+X^1+X^0
#define DAPINICRC 	0xFFFF // -1
#define DDCMPPOLY	0xA001 // X^16+X^15+X^2+X^0
#define DDCMPINICRC	0x0000 // 0
#define XXXPOLY		0x8408 // X^16+X^12+X^5+X^0
#define XXXPINICRC	0x0000 // 0

class vaxcrc
{
private:
    unsigned short	crc;
    unsigned short	crc_table[16];
 public:
    vaxcrc(unsigned short poly,unsigned short inicrc);
    unsigned short	getcrc();
    void 		setcrc(unsigned short newcrc);
    void 		calc1shift(unsigned char *stream, int len);
    void 		calc2shift(unsigned char *stream, int len);
    void 		calc4shift(unsigned char *stream, int len);
   
};
#endif