marshalBinaryUpdateAllowedKeyPageOperation method

Uint8List marshalBinaryUpdateAllowedKeyPageOperation(
  1. KeyOperation operation
)

Implementation

Uint8List marshalBinaryUpdateAllowedKeyPageOperation(KeyOperation operation) {
  List<int> forConcat = [];

  forConcat.addAll(uvarintMarshalBinary(operation.type!, 1));
  if (operation.allow != null) {
    operation.allow!.forEach((a) => forConcat.addAll(uvarintMarshalBinary(a, 2)));
  }

  if (operation.deny != null) {
    operation.deny!.forEach((d) => forConcat.addAll(uvarintMarshalBinary(d, 3)));
  }

  return forConcat.asUint8List();
}