private void TransmitFlag(KeyValuePair <string, string> kvp) { string ip = kvp.Key; string flag = kvp.Value; var sw = Stopwatch.StartNew(); var flagBytes = Encoding.GetEncoding(1251).GetBytes(flag); flagBytes = BitHelper.Encode5B4B(flagBytes); for (int i = 0; i < 8; i++) { comPort.Write(flagBytes, 0, flagBytes.Length); BitHelper.RotateLeft(flagBytes); } sw.Stop(); log.InfoFormat($"Transmitted flag {flag} for team {ip} in {sw.ElapsedMilliseconds}ms"); }