32 #include "../my_config.h"
50 static const U_I OLD_CRC_SIZE = 2;
53 crc(
const infinint & width);
54 crc(
const crc & ref) : i_cyclic(1) { copy_from(ref); };
55 const crc & operator = (
const crc & ref) { destroy(); copy_from(ref);
return *
this; };
56 ~crc() { destroy(); };
58 bool operator == (
const crc & ref)
const;
59 bool operator != (
const crc & ref)
const {
return ! (*
this == ref); };
61 void compute(
const infinint & offset,
const char *buffer, U_I length);
62 void compute(
const char *buffer, U_I length);
64 void dump(generic_file & f)
const;
65 void read(generic_file & f);
66 void old_read(generic_file & f);
67 std::string crc2str()
const;
68 void resize(
const infinint & width);
69 void resize(U_I width) { resize_non_infinint(width); };
70 void resize_based_on(
const crc & ref) { resize(ref.get_size()); };
71 infinint get_size()
const {
return infinint_mode ? i_size : n_size; };
73 static void set_crc_pointer(crc * & dst,
const crc *src);
80 storage::iterator i_pointer;
84 unsigned char *n_pointer;
85 unsigned char *n_cyclic;
87 void copy_from(
const crc & ref);
89 void resize_infinint(
const infinint & width);
90 void resize_non_infinint(U_I width);