Skip to content

Instantly share code, notes, and snippets.

public T[] generate_crc_table3(T)(T polynomial, T initialValue, bool refin) {
T[] table = new T[](256);
int i, j;
T bit, crc;
auto order = T.sizeof * 8;
for(i = 0; i < 256; i++) {
crc = cast(T)i;
if(refin) {