You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MessagePack has a compact binary size and a full set of general purpose expressive data types. Please have a look at the [comparison with JSON, protobuf, ZeroFormatter section](#comparison) and learn [why MessagePack C# is faster](#performance).
15
+
MessagePack has a compact binary size and a full set of general purpose expressive data types. Please have a look at the [comparison with JSON, protobuf, ZeroFormatter section](#comparison) and learn [why MessagePack C# is the fastest](#performance).
17
16
18
17
## Installation
19
18
20
19
This library is distributed via NuGet. Special [Unity support](#unity) is available, too.
21
20
22
21
We target .NET Standard 2.0 with special optimizations for .NET Core 2.1+, making it compatible with most reasonably recent .NET runtimes such as Core 2.0 and later, Framework 4.6.1 and later, Mono 5.4 and later and Unity 2018.3 and later.
23
-
The library code is pure C# (with Just-In-Time IL code generation on some platforms).
22
+
The library code is pure C# (with Just-In-Time IL code generation on some platforms).
24
23
25
24
### NuGet packages
25
+
26
26
To install with NuGet, just install the `MessagePack` package:
27
+
27
28
```ps1
28
29
Install-Package MessagePack
29
30
```
@@ -54,7 +55,7 @@ If you were using MessagePack for C# v1.x, check out the ["How to update to our
54
55
## Quick Start
55
56
56
57
Define the struct or class to be serialized and annotate it with a `[MessagePackObject]` attribute.
57
-
Annotate public members (fields as well as properties) with `[Key]` attributes.
58
+
Annotate members whose values should be serialized (fields as well as properties) with `[Key]` attributes.
58
59
59
60
```csharp
60
61
[MessagePackObject]
@@ -72,7 +73,7 @@ public class MyClass
72
73
[Key(2)]
73
74
publicstringLastName { get; set; }
74
75
75
-
//Public members that must not be serialized must be annoted [IgnoreMember].
76
+
//All fields or properties that should not be serialized must be annotated with [IgnoreMember].
76
77
[IgnoreMember]
77
78
publicstringFullName { get { returnFirstName+LastName; } }
78
79
}
@@ -111,7 +112,7 @@ By default, a `MessagePackObject` annotation is required. This can be made optio
111
112
112
113
## Analyzer
113
114
114
-
The MessagePackAnalyzer package aides with:
115
+
The MessagePackAnalyzer package aids with:
115
116
116
117
1. Automating definitions for your serializable objects.
117
118
1. Produces compiler warnings upon incorrect attribute use, member accessibility, and more.
@@ -134,7 +135,7 @@ These types can serialize by default:
Deserializing data from an untrusted source can introduce security vulnerabilities in your application.
574
576
Depending on the settings used during deserialization, **untrusted data may be able to execute arbitrary code** or cause a denial of service attack.
575
-
Untrusted data might come from over the network from an untrusted source (i.e. any and every networked client) or can be tampered with by an intermediary when transmitted over an unauthenticated connection, or from a local storage that might have been tampered with, or many other sources. MessagePack for C# does not provide any means to authenticate data or make it tamper-resistant. Please use an appropriate method of authenticating data before deserialzation - such as a [`MAC`](https://en.wikipedia.org/wiki/Message_authentication_code) .
577
+
Untrusted data might come from over the network from an untrusted source (e.g. any and every networked client) or can be tampered with by an intermediary when transmitted over an unauthenticated connection, or from a local storage that might have been tampered with, or many other sources. MessagePack for C# does not provide any means to authenticate data or make it tamper-resistant. Please use an appropriate method of authenticating data before deserialzation - such as a [`MAC`](https://en.wikipedia.org/wiki/Message_authentication_code) .
576
578
577
579
Please be very mindful of these attack scenarios; many projects and companies, and serialization library users in general, have been bitten by untrusted user data deserialization in the past.
578
580
@@ -595,7 +597,7 @@ The `UntrustedData` mode merely hardens against some common attacks, but is no f
595
597
596
598
## Performance
597
599
598
-
Benchmarks comparing MessagePack For C# to other serializers were run on `Windows 10 Pro x64 Intel Core i7-6700K 4.00GHz, 32GB RAM`. Benchmark code is [avaibale here](https://github.com/neuecc/ZeroFormatter/tree/master/sandbox/PerformanceComparison) - and their [version info](https://github.com/neuecc/ZeroFormatter/blob/bc63cb925d/sandbox/PerformanceComparison/packages.config).
600
+
Benchmarks comparing MessagePack For C# to other serializers were run on `Windows 10 Pro x64 Intel Core i7-6700K 4.00GHz, 32GB RAM`. Benchmark code is [available here](https://github.com/neuecc/ZeroFormatter/tree/master/sandbox/PerformanceComparison) - and their [version info](https://github.com/neuecc/ZeroFormatter/blob/bc63cb925d/sandbox/PerformanceComparison/packages.config).
599
601
ZeroFormatter and [FlatBuffers](https://google.github.io/flatbuffers/) have infinitely fast deserializers, so ignore their deserialization performance.
The `MessagePack.ImmutableCollection` package add support for type of the [System.Collections.Immutable](https://www.nuget.org/packages/System.Collections.Immutable/) library. It adds `ImmutableArray<>`, `ImmutableList<>`, `ImmutableDictionary<,>`, `ImmutableHashSet<>`, `ImmutableSortedDictionary<,>`, `ImmutableSortedSet<>`, `ImmutableQueue<>`, `ImmutableStack<>`, `IImmutableList<>`, `IImmutableDictionary<,>`, `IImmutableQueue<>`, `IImmutableSet<>`, `IImmutableStack<>` serialization support.
885
+
The `MessagePack.ImmutableCollection` package adds support for type of the [System.Collections.Immutable](https://www.nuget.org/packages/System.Collections.Immutable/) library. It adds `ImmutableArray<>`, `ImmutableList<>`, `ImmutableDictionary<,>`, `ImmutableHashSet<>`, `ImmutableSortedDictionary<,>`, `ImmutableSortedSet<>`, `ImmutableQueue<>`, `ImmutableStack<>`, `IImmutableList<>`, `IImmutableDictionary<,>`, `IImmutableQueue<>`, `IImmutableSet<>`, `IImmutableStack<>` serialization support.
884
886
885
887
The `MessagePack.ReactiveProperty` package adds support for types of the [ReactiveProperty](https://github.com/runceel/ReactiveProperty) library. It adds `ReactiveProperty<>`, `IReactiveProperty<>`, `IReadOnlyReactiveProperty<>`, `ReactiveCollection<>`, `Unit` serialization support. It is useful for save viewmodel state.
886
888
@@ -1004,7 +1006,8 @@ public class FileInfoFormatter<T> : IMessagePackFormatter<FileInfo>
0 commit comments