writeInt static method

String writeInt(
  1. int value
)

Implementation

static String writeInt(int value) {
  if (value < 0) {
    throw new Exception('Use writeSignedInt to encode negative numbers');
  }
  var byteHexList = Uint8List.fromList(hex.decode(twoByteHex(value)));
  for (var i = 0; i < byteHexList.length; i++) {
    if (i != 0) byteHexList[i] ^= 0x80;
  }
  var result = hex.encode(byteHexList.reversed.toList());
  return result;
}