mirror of
https://github.com/sochix/TLSharp.git
synced 2025-12-06 08:02:00 +01:00
pr updates amended pr review changes resolved merge conflicts updates from last night before rebase update on message test now passing removed nlog references and usage resolve conflicts from HEAD Reapply Events PR #679 update on message test now passing removed nlog references and usage
26 lines
612 B
C#
26 lines
612 B
C#
using System;
|
|
using System.Text;
|
|
|
|
namespace TLSharp.Core.Network
|
|
{
|
|
public static class Sniffer
|
|
{
|
|
public static string MessageOut(byte[] data)
|
|
{
|
|
return WriteMessage(new StringBuilder("[OUT]:"), data);
|
|
}
|
|
|
|
public static string MessageIn(byte[] data)
|
|
{
|
|
return WriteMessage(new StringBuilder("[IN]:"), data);
|
|
}
|
|
|
|
private static string WriteMessage(StringBuilder log, byte[] data)
|
|
{
|
|
foreach (var b in data)
|
|
log.AppendFormat(" {0:x2}", b);
|
|
return log.ToString();
|
|
}
|
|
}
|
|
}
|