Commit Graph

4 Commits

Author SHA1 Message Date
Gustavo Zacarias 7f0d4d56a2 lib/crc32: prefix public functions
Make the publicly-visible crc32 library functions prefixed by ul_, such
as crc32() -> ul_crc32().
This is because it clashes with the crc32() function from zlib.
For newer versions of glib (2.50+) zlib and libblkid are required
dependencies and otherwise results in build failure when building
statically.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
2016-10-19 12:11:59 +02:00
Karel Zak 7020de0be8 lib/crc32: don't require to modify GPT header
This patch introduces smart crc32 function that is able to exclude
specified. The advantage is that we does not have to modify GPT header
(set the current in-header crc field to zero) when we count crc32.

This allows to keep GPT header in read-only buffers and simplify code.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-09-24 09:26:42 +02:00
Karel Zak db2a3dda74 lib: add crc64()
Based on bcache code from Rolf Fokkens.

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-11 16:40:06 +02:00
Karel Zak 7176f22db5 lib: add a generic crc32()
This is public domain implementation, based on static crc32_table[].
This implementation is used on may places (libparted, FreeBSD kernel,
PostgreSQL, ...). The Linux kernel uses on-the-fly generated and
allocated tables. That's useless in shared libraries.

Signed-off-by: Karel Zak <kzak@redhat.com>
2009-09-16 16:17:41 +02:00