Function

FwupdPlugininput_stream_compute_crc32

since: 2.0.0

Declaration [src]

gboolean
fu_input_stream_compute_crc32 (
  GInputStream* stream,
  FuCrcKind kind,
  guint32* crc,
  GError** error
)

Description [src]

Returns the cyclic redundancy check value for the given memory buffer.

NOTE: The initial crc differs from fu_crc32_step() in that it is inverted (to make it symmetrical, and chainable), so for most uses you want to use the value of 0x0, not 0xFFFFFFFF.

Available since: 2.0.0

Parameters

stream

Type: GInputStream

A GInputStream.

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

Type: FuCrcKind

A FuCrcKind, typically FU_CRC_KIND_B32_STANDARD.

crc

Type: guint32*

Initial and final CRC value.

The argument will be modified by the function.
error

Type: GError **

The return location for a recoverable error.

The argument can be NULL.
If the return location is not NULL, then you must initialize it to a NULL GError*.
The argument will be left initialized to NULL by the function if there are no errors.
In case of error, the argument will be set to a newly allocated GError; the caller will take ownership of the data, and be responsible for freeing it.

Return value

Type: gboolean

TRUE for success.