# calculateChecksum static method

int calculateChecksum(

1. List<int> bytes

)

Calculates a simple checksum of a byte array.

Returns the sum of all bytes modulo 256, converted to signed byte.

Example:

    final checksum = Byte.calculateChecksum([1, 2, 3, 4]);  // 10
    final overflow = Byte.calculateChecksum([255, 255]);    // -2

## Implementation

    static int calculateChecksum(List<int> bytes) {
      final sum = bytes.fold<int>(0, (sum, byte) => sum + _signedToUnsigned(byte));
      return _unsignedToSigned(sum % 256);
    }