public byte[] GetPackedGUID(ulong guid) { byte[] guidBytes = BitConverter.GetBytes(guid); List packedGUID = new List(); packedGUID.Add(0); // mask for (int i = 0; i < 8; i++) { if (guidBytes[i] != 0) { packedGUID[0] |= (byte)(1 << i); packedGUID.Add(guidBytes[i]); } } return packedGUID.ToArray(); }