Function

FwupdPlugininput_stream_compute_crc16

Declaration [src]

gboolean
fu_input_stream_compute_crc16 (
  GInputStream* stream,
  FuCrcKind kind,
  guint16* crc,
  GError** error
)

Description [src]

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

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

Available since:2.0.0

Parameters

stream GInputStream
 

A GInputStream.

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

A FuCrcKind, typically FU_CRC_KIND_B16_XMODEM.

crc guint16*
 

Initial and final CRC value.

 The argument will be modified by the function.
error GError **
  The return location for a GError*, or NULL.

Return value

Returns: gboolean
 

TRUE for success.