$fromProtoBytes static method

BigInt $fromProtoBytes(
  1. List<int> bytes
)

Implementation

static BigInt $fromProtoBytes(List<int> bytes) {
  if (bytes.isEmpty) {
    return _bigZero;
  }
  var result = _bigZero;
  for (final byte in bytes) {
    result = (result << 8) + BigInt.from(byte);
  }
  result = result >> 1;
  if ((bytes.last & 1) == 1) {
    result = -result;
  }
  return result;
}