unpad function

Uint8List unpad(
  1. Uint8List a
)

Trims leading zeros from a Uint8List.

Implementation

Uint8List unpad(Uint8List a) {
  for (int i = 0; i < a.length; i++) {
    if (a[i] != 0) {
      return a.sublist(i);
    }
  }
  return Uint8List(0);
}