Converts a Uint8List to a int.
int bufferToInt(Uint8List buf) { return decodeBigInt(toBuffer(buf)).toInt(); }