Skip to content

Commit 0a41927

Browse files
README touch-ups
1 parent 25c9a91 commit 0a41927

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

README.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# MessagePack for C# (.NET, .NET Core, Unity, Xamarin)
32

43
[![NuGet](https://img.shields.io/nuget/v/MessagePack.svg)](https://www.nuget.org/packages/messagepack)
@@ -13,17 +12,19 @@ It is 10x faster than [MsgPack-Cli](https://github.com/msgpack/msgpack-cli) and
1312

1413
![Perf comparison graph](https://cloud.githubusercontent.com/assets/46207/23835716/89c8ab08-07af-11e7-9183-9e9415bdc87f.png)
1514

16-
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).
1716

1817
## Installation
1918

2019
This library is distributed via NuGet. Special [Unity support](#unity) is available, too.
2120

2221
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).
2423

2524
### NuGet packages
25+
2626
To install with NuGet, just install the `MessagePack` package:
27+
2728
```ps1
2829
Install-Package MessagePack
2930
```
@@ -54,7 +55,7 @@ If you were using MessagePack for C# v1.x, check out the ["How to update to our
5455
## Quick Start
5556

5657
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.
5859

5960
```csharp
6061
[MessagePackObject]
@@ -72,7 +73,7 @@ public class MyClass
7273
[Key(2)]
7374
public string LastName { get; set; }
7475

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].
7677
[IgnoreMember]
7778
public string FullName { get { return FirstName + LastName; } }
7879
}
@@ -111,7 +112,7 @@ By default, a `MessagePackObject` annotation is required. This can be made optio
111112

112113
## Analyzer
113114

114-
The MessagePackAnalyzer package aides with:
115+
The MessagePackAnalyzer package aids with:
115116

116117
1. Automating definitions for your serializable objects.
117118
1. Produces compiler warnings upon incorrect attribute use, member accessibility, and more.
@@ -134,7 +135,7 @@ These types can serialize by default:
134135

135136
* Primitives (`int`, `string`, etc...), `Enum`s, `Nullable<>`, `Lazy<>`
136137
* `TimeSpan`, `DateTime`, `DateTimeOffset`
137-
* `Nil`, `Guid`, `Uri`, `Version`, `StringBuilder`
138+
* `Guid`, `Uri`, `Version`, `StringBuilder`
138139
* `BigInteger`, `Complex`
139140
* `Array[]`, `Array[,]`, `Array[,,]`, `Array[,,,]`, `ArraySegment<>`, `BitArray`
140141
* `KeyValuePair<,>`, `Tuple<,...>`, `ValueTuple<,...>`
@@ -149,6 +150,7 @@ These types can serialize by default:
149150
* Custom implementations of `ICollection` or `IDictionary` with a parameterless constructor
150151

151152
You can add support for custom types, and there are some official/third-party extension packages for:
153+
152154
* ImmutableCollections (`ImmutableList<>`, etc)
153155
* ReactiveProperty
154156
* for Unity (`Vector3`, `Quaternion`, etc...)
@@ -572,7 +574,7 @@ MessagePack.Formatters.TypelessFormatter.BindToType = typeName =>
572574

573575
Deserializing data from an untrusted source can introduce security vulnerabilities in your application.
574576
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) .
576578

577579
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.
578580

@@ -595,7 +597,7 @@ The `UntrustedData` mode merely hardens against some common attacks, but is no f
595597

596598
## Performance
597599

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).
599601
ZeroFormatter and [FlatBuffers](https://google.github.io/flatbuffers/) have infinitely fast deserializers, so ignore their deserialization performance.
600602

601603
![image](https://cloud.githubusercontent.com/assets/46207/23835765/55fe494e-07b0-11e7-98be-5e7a9411da40.png)
@@ -880,7 +882,7 @@ Install-Package MessagePack.UnityShims
880882
Install-Package MessagePack.AspNetCoreMvcFormatter
881883
```
882884

883-
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.
884886

885887
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.
886888

@@ -1004,7 +1006,8 @@ public class FileInfoFormatter<T> : IMessagePackFormatter<FileInfo>
10041006
public void Serialize(
10051007
ref MessagePackWriter writer, FileInfo value, MessagePackSerializerOptions options)
10061008
{
1007-
if (value == null) {
1009+
if (value == null)
1010+
{
10081011
writer.WriteNil();
10091012
return;
10101013
}
@@ -1015,7 +1018,8 @@ public class FileInfoFormatter<T> : IMessagePackFormatter<FileInfo>
10151018
public FileInfo Deserialize(
10161019
ref MessagePackReader reader, MessagePackSerializerOptions options)
10171020
{
1018-
if (reader.TryReadNil()) {
1021+
if (reader.TryReadNil())
1022+
{
10191023
return null;
10201024
}
10211025

0 commit comments

Comments
 (0)