Skip to content

Instantly share code, notes, and snippets.

@YuvalItzchakov
Created December 14, 2015 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save YuvalItzchakov/9b404a63337f35b5dc7e to your computer and use it in GitHub Desktop.
Save YuvalItzchakov/9b404a63337f35b5dc7e to your computer and use it in GitHub Desktop.
static void GetSize(string msg)
{
byte[] data = Encoding.ASCII.GetBytes(msg);
byte[] sizeinfo = new byte[4];
sizeinfo[0] = (byte)data.Length;
sizeinfo[1] = (byte)(data.Length >> 8);
sizeinfo[2] = (byte)(data.Length >> 16);
sizeinfo[3] = (byte)(data.Length >> 24);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment