diff options
author | Mary <mary@mary.zone> | 2023-03-12 03:24:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-12 03:24:11 +0100 |
commit | d56d335c0bcd37672debd30896d47694fb29f905 (patch) | |
tree | a7aa93cdc005364e246e5237b10be03b3c0374d3 /Ryujinx.Input/Motion/CemuHook/Client.cs | |
parent | 23c844b2aa84a65e573dcc023d19b8f5294a8baf (diff) |
misc: Some dependencies cleanup (#4507)1.1.658
* Remove dependencies on libraries provided by .NET standard library
* Use System.IO.Hashing instead of Crc32.NET
Diffstat (limited to 'Ryujinx.Input/Motion/CemuHook/Client.cs')
-rw-r--r-- | Ryujinx.Input/Motion/CemuHook/Client.cs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Ryujinx.Input/Motion/CemuHook/Client.cs b/Ryujinx.Input/Motion/CemuHook/Client.cs index ecaf26f0..f5f7b864 100644 --- a/Ryujinx.Input/Motion/CemuHook/Client.cs +++ b/Ryujinx.Input/Motion/CemuHook/Client.cs @@ -1,5 +1,4 @@ -using Force.Crc32; -using Ryujinx.Common; +using Ryujinx.Common; using Ryujinx.Common.Configuration.Hid; using Ryujinx.Common.Configuration.Hid.Controller; using Ryujinx.Common.Configuration.Hid.Controller.Motion; @@ -9,6 +8,7 @@ using Ryujinx.Input.Motion.CemuHook.Protocol; using System; using System.Collections.Generic; using System.IO; +using System.IO.Hashing; using System.Net; using System.Net.Sockets; using System.Numerics; @@ -401,10 +401,10 @@ namespace Ryujinx.Input.Motion.CemuHook writer.Seek(6, SeekOrigin.Begin); writer.Write(header.Length); - header.Crc32 = Crc32Algorithm.Compute(stream.ToArray()); + Crc32.Hash(stream.ToArray(), header.Crc32.AsSpan()); writer.Seek(8, SeekOrigin.Begin); - writer.Write(header.Crc32); + writer.Write(header.Crc32.AsSpan()); byte[] data = stream.ToArray(); @@ -440,10 +440,10 @@ namespace Ryujinx.Input.Motion.CemuHook writer.Seek(6, SeekOrigin.Begin); writer.Write(header.Length); - header.Crc32 = Crc32Algorithm.Compute(stream.ToArray()); + Crc32.Hash(stream.ToArray(), header.Crc32.AsSpan()); writer.Seek(8, SeekOrigin.Begin); - writer.Write(header.Crc32); + writer.Write(header.Crc32.AsSpan()); byte[] data = stream.ToArray(); @@ -458,8 +458,7 @@ namespace Ryujinx.Input.Motion.CemuHook Id = (uint)clientId, MagicString = Magic, Version = Version, - Length = 0, - Crc32 = 0 + Length = 0 }; return header; |