checksum

numcodecs_safeguards.checksum

Functions:

  • checksum

    Compute the [RFC 1071] "Internet Checksum" over the little-endian C-order

checksum

checksum(data: ndarray[S, dtype[T]]) -> bytes

Compute the [RFC 1071] "Internet Checksum" over the little-endian C-order bytes of the data array.

The 16bit checksum is returned as two bytes in big-endian order.

Parameters:
  • data (ndarray[S, dtype[T]]) –

    The array to compute the checksum for.

Returns:
  • checksum( bytes ) –

    Two byte checksum in big-endian order.

  • [RFC 1071]: https://datatracker.ietf.org/doc/html/rfc1071