aboutsummaryrefslogtreecommitdiffstats
path: root/tools/ioemu/iodev/crc32.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/ioemu/iodev/crc32.h')
-rw-r--r--tools/ioemu/iodev/crc32.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/tools/ioemu/iodev/crc32.h b/tools/ioemu/iodev/crc32.h
new file mode 100644
index 0000000000..faedaf840b
--- /dev/null
+++ b/tools/ioemu/iodev/crc32.h
@@ -0,0 +1,25 @@
+/////////////////////////////////////////////////////////////////////////
+// $Id: crc32.h,v 1.3 2001/10/03 13:10:38 bdenney Exp $
+/////////////////////////////////////////////////////////////////////////
+//
+/* CRC-32 calculator
+ * Adapted from http://www.createwindow.org/programming/crc32/
+ */
+
+#ifndef _CRC_32_H_
+#define _CRC_32_H_
+
+#include "bochs.h"
+
+class CRC_Generator {
+private:
+ Bit32u crc32_table[256];
+ Bit32u reflect(Bit32u ref, Bit8u ch);
+public:
+ void init(void);
+ CRC_Generator();
+ Bit32u get_CRC(Bit8u * buf, Bit32u buflen);
+};
+
+#endif //_CRC_32_H_
+