| 4 | |
| 5 | template <class T> |
| 6 | T reflect(T bin, unsigned width = sizeof(T) * 8) |
| 7 | { |
| 8 | T bout = 0; |
| 9 | while (width--) |
| 10 | { |
| 11 | bout <<= 1; |
| 12 | bout |= (bin & 1); |
| 13 | bin >>= 1; |
| 14 | } |
| 15 | return bout; |
| 16 | } |
| 17 | |
| 18 | uint64_t generic_crc(const struct crcspec& spec, const Bytes& bytes) |
| 19 | { |