Return the CRC of the bytes buf[0..len-1].*/
| 2301 | |
| 2302 | /*Return the CRC of the bytes buf[0..len-1].*/ |
| 2303 | unsigned lodepng_crc32(const unsigned char* buf, size_t len) |
| 2304 | { |
| 2305 | unsigned c = 0xffffffffL; |
| 2306 | size_t n; |
| 2307 | |
| 2308 | for(n = 0; n < len; n++) |
| 2309 | { |
| 2310 | c = lodepng_crc32_table[(c ^ buf[n]) & 0xff] ^ (c >> 8); |
| 2311 | } |
| 2312 | return c ^ 0xffffffffL; |
| 2313 | } |
| 2314 | |
| 2315 | /* ////////////////////////////////////////////////////////////////////////// */ |
| 2316 | /* / Reading and writing single bits and bytes from/to stream for LodePNG / */ |
no outgoing calls
no test coverage detected