{"id":17205468,"url":"https://github.com/rikimaru0345/ceras","last_synced_at":"2025-05-15T15:07:30.729Z","repository":{"id":37502785,"uuid":"151394105","full_name":"rikimaru0345/Ceras","owner":"rikimaru0345","description":"Universal binary serializer for a wide variety of scenarios https://discord.gg/FGaCX4c","archived":false,"fork":false,"pushed_at":"2023-12-31T04:44:11.000Z","size":1210,"stargazers_count":497,"open_issues_count":40,"forks_count":55,"subscribers_count":33,"default_branch":"master","last_synced_at":"2025-05-15T15:07:22.817Z","etag":null,"topics":["binary","c-sharp","csharp","database","dotnet","dotnet-core","formatter","msgpack","net","network","networking","persistent-storage","protocol","serialisation","serialization","serialize-objects","serializer"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rikimaru0345.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"rikimaru0345","custom":"https://www.paypal.me/rikimaru0345","ko_fi":"rikimaru","patreon":null,"open_collective":null}},"created_at":"2018-10-03T10:12:24.000Z","updated_at":"2025-04-21T02:19:59.000Z","dependencies_parsed_at":"2024-01-05T20:52:03.080Z","dependency_job_id":"8871ebd9-f9d3-4cc4-918f-a01b0293fc54","html_url":"https://github.com/rikimaru0345/Ceras","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikimaru0345%2FCeras","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikimaru0345%2FCeras/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikimaru0345%2FCeras/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rikimaru0345%2FCeras/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rikimaru0345","download_url":"https://codeload.github.com/rikimaru0345/Ceras/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254364270,"owners_count":22058878,"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","c-sharp","csharp","database","dotnet","dotnet-core","formatter","msgpack","net","network","networking","persistent-storage","protocol","serialisation","serialization","serialize-objects","serializer"],"created_at":"2024-10-15T02:25:25.771Z","updated_at":"2025-05-15T15:07:25.720Z","avatar_url":"https://github.com/rikimaru0345.png","language":"C#","funding_links":["https://github.com/sponsors/rikimaru0345","https://www.paypal.me/rikimaru0345","https://ko-fi.com/rikimaru"],"categories":[],"sub_categories":[],"readme":"Ceras\n===\n[![AppVeyor](https://ci.appveyor.com/api/projects/status/github/rikimaru0345/Ceras?branch=master\u0026svg=true)](https://ci.appveyor.com/project/rikimaru0345/ceras/build/artifacts)  [![Test Results](https://img.shields.io/appveyor/tests/rikimaru0345/ceras.svg)](https://ci.appveyor.com/project/rikimaru0345/ceras/build/tests) [![Discord](https://discordapp.com/api/guilds/367211057787305985/embed.png)](https://discord.gg/FGaCX4c) [![NuGet](https://img.shields.io/nuget/v/Ceras.svg?logo=nuget\u0026logoColor=ddd)](https://www.nuget.org/packages/Ceras/)  [![Release](https://img.shields.io/badge/download-70kb%20%5Brelease.zip%5D-blue.svg?logo=appveyor )](https://ci.appveyor.com/project/rikimaru0345/ceras/build/artifacts) \n\nCeras is a binary serializer. It converts *any* object into a `byte[]` and back.\nIt goes above and beyond in terms of features, speed, and comfort.\nSupports reference loops, large/complicated inheritance chains, splitting objects into parts, ...\n\n## Quick start\n\n```csharp\nclass Person { public string Name; public int Age; }\nvar p = new Person { Name = \"riki\", Age = 5 };\n\nvar ceras = new CerasSerializer();\n\nvar bytes = ceras.Serialize(p);\n```\n\n1. [**\u003e\u003e Many more examples in the code tutorial**](https://github.com/rikimaru0345/Ceras/blob/master/src/Tutorial/Tutorial.cs)\n2. [**\u003e\u003e Detailed guides for specific scenarios on my blog**](https://www.rikidev.com/)\n3. [**\u003e\u003e Read 'Optimization \u0026 Usage Pitfalls'**](https://github.com/rikimaru0345/Ceras/wiki/Optimization-\u0026-Pitfalls)\n- [**\u003e\u003e Changelog v3.0 (rikidev.com/new-features-in-ceras-3-0-2)**](https://www.rikidev.com/new-features-in-ceras-3-0-2/)\n- [**\u003e\u003e New features in v4.0 (https://github.com/rikimaru0345/Ceras/releases/tag/4.0)**](https://github.com/rikimaru0345/Ceras/releases/tag/4.0)\n\n\n## Features\n\n- Very fast, small binary output (see **[Performance](https://github.com/rikimaru0345/Ceras#performance-benchmarks)**)\n- Supports pretty much any type:\n\t- [Hand-written formatters for all common .NET types](https://github.com/rikimaru0345/Ceras/wiki/Full-feature-list-\u0026-planned-features#built-in-types)\n\t- [Comes with formatters for all common Unity types](https://github.com/rikimaru0345/Ceras/tree/master/src/Ceras.UnityAddon)\n\t- Generates new formatters at runtime for any new/user type\n\t- [Very easy to extend and customize](https://www.rikidev.com/extending-ceras-with-a-custom-formatter/)\n- **Full** support for reference persistence (including circular references!)\n- **Full** support for polymorphism / inheritance / interfaces\n- Can serialize objects into parts as \"ExtenalObjects\" (useful in many many scenarios)\n- Automatic version-tolerance, no need to place any attributes on your classes!\n- ***[full feature list (and planned features)](https://github.com/rikimaru0345/Ceras/wiki/Full-feature-list-\u0026-planned-features)***\n\n## Performance benchmarks\nCeras generally ranks at the top end of the performance spectrum, together with NetSerializer and MessagePack-CSharp.\nTo get an idea of how Ceras performs here are the preliminary benchmark results.\nThe resulting binary size is about the same as MessagePack-CSharp.\n\n![Single object performance benchmark](https://i.imgur.com/Q896UgV.png)\n\nThe shown results are obtained from **[this code](https://github.com/rikimaru0345/Ceras/blob/master/samples/LiveTesting/Benchmarks.cs)** and I encourage you to not only try it yourself, but to also provide feedback about scenarios you had good and bad results with.\n\nDon't forget to tune the settings in `SerializerConfig` for your specific situation.\nUsing Ceras to read/write network packets might require different settings than, lets say, saving a settings-object to a file, or persisting items/spells/monsters in a game, or ... \n\nThe project is still heavily work-in-progress, meaning that over time more optimizations will get implemented (your feedback is important here!).\n\n## What can this be used for?\n\n### Example usages\nThe primary goal is to make an universal serializer that can be used in every situation.\nPersonally my primary intentions were easy object persistance and network communication.\nI've added many features over time and whenever someone can think of a good scenario that should be supported as well I'll make it happen. \n\nExamples:\n- **Settings:**\nSaving objects to disk quickly without much trouble: settings, savegames, whatever it  is. With pretty much zero config.\nSee steps 1 and 2 in the [Usage Guide](https://github.com/rikimaru0345/Ceras/blob/master/src/Tutorial/Tutorial.cs#L22)\n\n- **Splitting:**\nSo your `Person` has references to other `Person` objects, but each one should be serialized individually!? (without the references quickly dragging in essentially your whole program).\nMaybe you want to be able to put each `Person` into its own file, or send them over the network one-by-one as needed?\n**No problem!** Using `IExternalRootObject` it's not an issue! See [External Objects Guide (Game DB example))](https://github.com/rikimaru0345/Ceras/blob/master/src/Tutorial/Tutorial.cs#L350).\n\n- **Network:** \nBecause of its simple API and vast set of features Ceras is uniquely suited to implement a full 'network-protocol' for you.\nI wrote [a short guide](https://rikidev.com/networking-with-ceras-part-1/) that shows off how a basic  TCP implementation could look like:\nJust `Send(myObject);` it, then `var obj = await Receive();` on the other side, that's it! It literally can't get any easier than that.\nAt the moment the guide only has 2 parts, but when I have some (and if there are requests for it) I'd like to continue the series, eventually building that sample into a full-fledged, robust, and battle-tested networking system.\n\n- **More:**\nThe above are just examples, Ceras is made so it can be used in pretty much every situation...\n\n### When should I not use this?\n\n- If you need human readable output for some reason. For example some file that you want to be able to edit in a text-editor. For those usages JSON or XML are likely better suited.\n\n- ~~You plan to use this on a platform that does not support code generation. Serializers for user-types are created at runtime through code-generation. And if that isn't allowed (for example on iOS) Ceras won't be able to generate arbitrary object-formatters. Built-in types will still work though. There are ways to fix this though... (pre-generating the formatters)~~\n  Ceras now has a dedicated `AotMode` in the config and a [code-generator](https://github.com/rikimaru0345/Ceras/tree/master/src/Ceras.AotGenerator) ([quick guide for it here](https://github.com/rikimaru0345/Ceras/wiki/Unity-IL2CPP-(iOS-and-AOT))) for IL2CPP/Unity/AoT.\n\n\n# Support\n- Open an issue\n- Join my [Discord](https://discord.gg/FGaCX4c) (probably the best for direct one-on-one help)\n- Make sure you've read [FAQ](https://github.com/rikimaru0345/Ceras/wiki/FAQ) and [Optimization \u0026 Pitfalls](https://github.com/rikimaru0345/Ceras/wiki/Optimization-\u0026-Pitfalls)\n\n## [**\u003e\u003e FAQ**](https://github.com/rikimaru0345/Ceras/wiki/FAQ)\n## [**\u003e\u003e Development Blog**](https://rikidev.com/)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frikimaru0345%2Fceras","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frikimaru0345%2Fceras","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frikimaru0345%2Fceras/lists"}