Function

FwupdPlugincrc_find

since: 2.0.0

Declaration [src]

FuCrcKind
fu_crc_find (
  const guint8* buf,
  gsize bufsz,
  guint32 crc_target
)

Description [src]

Returns the cyclic redundancy kind for the given memory buffer and target CRC.

You can use a very simple buffer to discover most types of standard CRC-32:

guint8 buf[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 }; g_info(“CRC:%u”, fu_crc_find(buf, sizeof(buf), _custom_crc(buf, sizeof(buf))));.

Available since: 2.0.0

Parameters

buf

Type: const guint8*

Memory buffer.

The data is owned by the caller of the function.
bufsz

Type: gsize

Size of buf.

crc_target

Type: guint32

correct” CRC value.

Return value

Type: FuCrcKind

A FuCrcKind, or FU_CRC_KIND_UNKNOWN on error.