{"id":19165828,"url":"https://github.com/barchart/binary-serializer-public","last_synced_at":"2025-04-09T16:50:27.655Z","repository":{"id":258995864,"uuid":"751411234","full_name":"barchart/binary-serializer-public","owner":"barchart","description":"An efficient library for serializing (and deserializing) arbitrary objects to (and from) binary","archived":false,"fork":false,"pushed_at":"2025-03-04T00:31:03.000Z","size":1938,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-23T18:54:18.286Z","etag":null,"topics":["binary","binary-serialization","csharp","dotnet","public-repository","serialization"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/barchart.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":"2024-02-01T15:03:18.000Z","updated_at":"2025-03-04T00:28:37.000Z","dependencies_parsed_at":"2024-11-04T13:33:51.489Z","dependency_job_id":"31bd72f0-234c-4ccb-a187-b31cf2db1e7d","html_url":"https://github.com/barchart/binary-serializer-public","commit_stats":null,"previous_names":["barchart/binary-serializer-public"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barchart%2Fbinary-serializer-public","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barchart%2Fbinary-serializer-public/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barchart%2Fbinary-serializer-public/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barchart%2Fbinary-serializer-public/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barchart","download_url":"https://codeload.github.com/barchart/binary-serializer-public/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248072471,"owners_count":21043238,"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","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":["binary","binary-serialization","csharp","dotnet","public-repository","serialization"],"created_at":"2024-11-09T09:29:27.529Z","updated_at":"2025-04-09T16:50:27.624Z","avatar_url":"https://github.com/barchart.png","language":"C#","readme":"# @barchart/binary-serializer-public\n\n[![AWS CodeBuild](https://codebuild.us-east-1.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoidWY3K0VOSGJIcVkxU29ERTRDUGs3SVZFZ21IeWVLaHEwdDBDMlZwckJyUGVaaSt1ajZzVk4wSkFFWTlFTlRvK25OZS9HSkxqMmdqNWw3YW0wVk5jYUdRPSIsIml2UGFyYW1ldGVyU3BlYyI6ImYrN2xMY1RTY0lDSllOYm4iLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D\u0026branch=main)](https://github.com/barchart/binary-serializer-public)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nThe Binary Serializer is a library designed for serializing objects (into a binary format) and deserializing objects (from the binary format).\n\n## Key Features\n\n- **Easy (De)serialization**: Convert objects into byte arrays and vice versa.\n- **Customizable**: Adjust the serialization process to fit your needs.\n- **Extensible**: Add new features to the library as needed.\n- **Lightweight**: Easy to add to your existing projects.\n\n## Example:\n\nWhen serializing an object, the data is converted into a binary array. For example, consider the following class:\n\n```csharp   \n\npublic class Person\n{\n    [Serialize]\n    public string Name { get; set; } = \"\";\n    \n    [Serialize]\n    public ushort Age { get; set; } = 0;\n      \n    [Serialize]\n    public bool IsProgrammer { get; set; } = false;  \n}\n``` \n\nHere is an example of what the byte representation might look like:\n\n```aiignore\n10000000 00000001 01000000 00010000 10011100 10011110 01011000 01011011 10000110 00100000 00001000\n```\n### Byte Representation:\n\n- **10000000**: Represents a `Header` byte. The first bit (1) indicates whether the data is a `Snapshot`. If the bit is set to 1, it means the data is a snapshot; otherwise, it is not. The last four bits (0000) represent the `EntityId`, which helps identify the type of entity the data represents. The `EntityId` can range from 0 to 15 (4 bits).\n- **00000001 01000000 00xxxxxx**: First two bits (00) represent the `IsMissing` and `IsNull` flags. The next two bytes (xx000001 01000000 000100xx) represents the string `length`.\n- **xx010000 10011100 10011110 01011000 01011011 10xxxxxx**: Represents the encoded values of the characters in the `Name` property value using UTF-8 encoding by default (or any other encoding specified).\n- **xx000110 00100000 000xxxxx**: First bit (0) represent the `IsMissing` flag. Tne next 2 bytes represents the ushort value for the `Age` property.\n- **xxx01000**: First bit (0) represent the `IsMissing` flag. Tne next bit (1) represents a boolean value for the `IsProgrammer` property.\n\n### Property Flags: IsMissing and IsNull\n\nFor each non-key nullable property, two bits are reserved to indicate its state:\n\n* IsMissing (1 bit):\n\n    * If set to 1, the property is absent from the serialized data.\n\n    * If set to 0, the property is included in the serialized data.\n\n* IsNull (1 bit):\n\n    * If set to 1, the property is present but its value is null.\n\n    * If set to 0, the property has a valid, non-null value.\n\n\u003e Key properties and non-nullable value types (e.g., int, bool, etc.) have a different binary representation. They are always present so they do not have an `IsMissing flag`, only an `IsNull` flag.\n\n### License\n\nThis software is available for use under the MIT license.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarchart%2Fbinary-serializer-public","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarchart%2Fbinary-serializer-public","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarchart%2Fbinary-serializer-public/lists"}