mirror of
https://github.com/kwsch/NHSE.git
synced 2026-08-13 13:15:47 -05:00
Rewrite crypto to use span
This commit is contained in:
@@ -1,20 +1,5 @@
|
||||
namespace NHSE.Core;
|
||||
using System;
|
||||
|
||||
public readonly ref struct EncryptedSaveFile
|
||||
{
|
||||
public readonly byte[] Data;
|
||||
public readonly byte[] Header;
|
||||
namespace NHSE.Core;
|
||||
|
||||
public EncryptedSaveFile(byte[] data, byte[] header)
|
||||
{
|
||||
Data = data;
|
||||
Header = header;
|
||||
}
|
||||
|
||||
#region Equality Comparison
|
||||
public override bool Equals(object? obj) => false;
|
||||
public override int GetHashCode() => Data.GetHashCode();
|
||||
public static bool operator !=(EncryptedSaveFile left, EncryptedSaveFile right) => !(left == right);
|
||||
public static bool operator ==(EncryptedSaveFile left, EncryptedSaveFile right) => left.Data == right.Data && left.Header == right.Header;
|
||||
#endregion
|
||||
}
|
||||
public readonly record struct EncryptedSaveFile(ReadOnlyMemory<byte> Data, ReadOnlyMemory<byte> Header);
|
||||
Reference in New Issue
Block a user