{"id":24958708,"url":"https://github.com/emrecpp/datapacket-csharp","last_synced_at":"2025-09-15T09:04:11.456Z","repository":{"id":167313469,"uuid":"337508615","full_name":"emrecpp/DataPacket-CSharp","owner":"emrecpp","description":"Send, recv, encrypt, decrypt, compress data as Packet and send it with socket for C#.","archived":false,"fork":false,"pushed_at":"2022-02-12T17:59:36.000Z","size":97,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-15T09:03:30.027Z","etag":null,"topics":["compress","data","deserialization","deserialize","deserializer","encrypt","packet","send","serialization","serialize","serializer","socket"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emrecpp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-09T19:08:57.000Z","updated_at":"2025-04-15T11:19:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"f6ed6672-47ca-4602-a6b2-efc8d89e84e0","html_url":"https://github.com/emrecpp/DataPacket-CSharp","commit_stats":null,"previous_names":["emrecpp/datapacket-csharp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/emrecpp/DataPacket-CSharp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrecpp%2FDataPacket-CSharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrecpp%2FDataPacket-CSharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrecpp%2FDataPacket-CSharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrecpp%2FDataPacket-CSharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emrecpp","download_url":"https://codeload.github.com/emrecpp/DataPacket-CSharp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emrecpp%2FDataPacket-CSharp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275232726,"owners_count":25428227,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-15T02:00:09.272Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compress","data","deserialization","deserialize","deserializer","encrypt","packet","send","serialization","serialize","serializer","socket"],"created_at":"2025-02-03T07:27:51.276Z","updated_at":"2025-09-15T09:04:11.424Z","avatar_url":"https://github.com/emrecpp.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data Packet for C#\nStore data as packet. Send, Recv, Encrypt it.\n\nFor Pyhon: https://github.com/emrecpp/PacketHandler\n\nFor C++: https://github.com/emrecpp/DataPacket-CPP\n\n\n# Example Usage\n\n```\nprivate static class opcodes\n{\n    public static int HANDSHAKE = 100;\n}\n        \nPacket pkt = new Packet(opcodes.HANDSHAKE, littleEndian: false);\npkt.writeInt(123456);\npkt.writeString(\"Emre Demircan\");\n  \nint Number = pkt.readInt(); // 123456\nstring Name = pkt.readString(); // Emre Demircan\n```\n## Send\n```\nClient client = new Client(\"127.0.0.1\", 2000);\n\nPacket sendData = new Packet(0xAABB);\nsendData.writeInt(123456);\nsendData.writeString(\"Emre Demircan\");\nsendData.Encrypt(); // automatically will be decrypted when received packet.\n\nif (!sendData.Send(client.s)) // Client -\u003e Server\n    MessageBox.Show(\"Send Failed\");\n```\n\n\n## Recv\n```\npublic int ClientHandler(Socket client)\n{\n    Packet pktReceiver = new Packet();\n    while (client.Connected)\n    {\n        if (!pktReceiver.Recv(client))\n            break;\n\n        if (pktReceiver.GetOpcode() == 0xAABB)\n        {\n            int Number = pktReceiver.readInt(); //123456\n            string Name = pktReceiver.readString(); // Emre Demircan\n            \n            Console.WriteLine(\"Opcode: \"+ pktReceiver.GetOpcode());            \n            Console.WriteLine(\"Number:\" + Number);\n            Console.WriteLine(\"Name:\" + Name);            \n        }\n    }\n    return 0;\n}\n\nServer server = new Server(2000, ClientHandler);\n```\n\n# Output:\n```\nOpcode: 43707 (0xAABB)\nNumber: 123456\nName: Emre Demircan\n\n\nsendData.Print();\n\nLittle Endian\n\n\nNormal/Decrypted Print:\n00000000 AA BB 02 02 00 00 7B 00 00 00 0D 00 00 00 45 6D   ??.\u0002.?{?.?.?.?Em\n00000010 72 65 20 44 65 6D 69 72 63 61 6E                  re.Demircan\n\nEncrypted Print:\n00000000 AA BB 03 02 00 00 3F C0 BC B8 C1 B0 AC A8 E9 0D   ??.\u0002.??????????\n00000010 0E FD B4 D4 F1 F5 ED F2 DF D9 E2                  .??????????\n\n\n\nBig Endian\n\n\nNormal/Decrypted Print:\n00000000 AA BB 00 02 00 00 00 00 00 7B 00 00 00 0D 45 6D   ??.\u0002.?.?.{.?.Em\n00000010 72 65 20 44 65 6D 69 72 63 61 6E                  re.Demircan\n\nEncrypted Print:\n00000000 AA BB 01 02 00 00 C4 C0 BC 33 B4 B0 AC B5 E9 0D   ??.\u0002.????3?????\n00000010 0E FD B4 D4 F1 F5 ED F2 DF D9 E2                  .??????????\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femrecpp%2Fdatapacket-csharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femrecpp%2Fdatapacket-csharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femrecpp%2Fdatapacket-csharp/lists"}