diff --git a/Adler32Context.cs b/Adler32Context.cs index 95569a2..7e52653 100644 --- a/Adler32Context.cs +++ b/Adler32Context.cs @@ -37,6 +37,7 @@ // ****************************************************************************/ using System; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Runtime.InteropServices; using System.Runtime.Intrinsics.Arm; @@ -50,6 +51,7 @@ namespace Aaru.Checksums; /// /// Implements the Adler-32 algorithm +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] public sealed class Adler32Context : IChecksum { internal const ushort ADLER_MODULE = 65521; diff --git a/CRC16CCITTContext.cs b/CRC16CCITTContext.cs index 099674a..23b85b2 100644 --- a/CRC16CCITTContext.cs +++ b/CRC16CCITTContext.cs @@ -30,10 +30,13 @@ // Copyright © 2011-2023 Natalia Portillo // ****************************************************************************/ +using System.Diagnostics.CodeAnalysis; + namespace Aaru.Checksums; /// /// Implements the CRC16 algorithm with CCITT polynomial and seed +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] public sealed class CRC16CCITTContext : Crc16Context { /// CCITT CRC16 polynomial diff --git a/CRC16IBMContext.cs b/CRC16IBMContext.cs index 4577fc8..3ee9fae 100644 --- a/CRC16IBMContext.cs +++ b/CRC16IBMContext.cs @@ -30,10 +30,15 @@ // Copyright © 2011-2023 Natalia Portillo // ****************************************************************************/ +using System.Diagnostics.CodeAnalysis; + namespace Aaru.Checksums; /// /// Implements the CRC16 algorithm with IBM polynomial and seed +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +[SuppressMessage("ReSharper", "MemberCanBeInternal")] public sealed class CRC16IBMContext : Crc16Context { internal const ushort CRC16_IBM_POLY = 0xA001; @@ -233,6 +238,7 @@ public sealed class CRC16IBMContext : Crc16Context /// Gets the hash of a file /// File path. + // ReSharper disable once ReturnTypeCanBeEnumerable.Global public static byte[] File(string filename) { File(filename, out byte[] hash); diff --git a/CRC32Context.cs b/CRC32Context.cs index fb1e5d4..b97a70f 100644 --- a/CRC32Context.cs +++ b/CRC32Context.cs @@ -31,6 +31,7 @@ // ****************************************************************************/ using System; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Runtime.InteropServices; using System.Runtime.Intrinsics.Arm; @@ -44,6 +45,10 @@ namespace Aaru.Checksums; /// /// Implements a CRC32 algorithm +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "MemberCanBeInternal")] +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] public sealed class Crc32Context : IChecksum { const uint CRC32_ISO_POLY = 0xEDB88320; @@ -524,6 +529,7 @@ public sealed class Crc32Context : IChecksum /// Gets the hash of a file /// File path. + // ReSharper disable once ReturnTypeCanBeEnumerable.Global public static byte[] File(string filename) { File(filename, out byte[] hash); diff --git a/CRC64Context.cs b/CRC64Context.cs index 8189b00..822d2a5 100644 --- a/CRC64Context.cs +++ b/CRC64Context.cs @@ -31,6 +31,7 @@ // ****************************************************************************/ using System; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Runtime.InteropServices; using System.Runtime.Intrinsics.X86; @@ -43,12 +44,16 @@ namespace Aaru.Checksums; /// /// Implements a CRC64 algorithm +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +[SuppressMessage("ReSharper", "MemberCanBeInternal")] public sealed class Crc64Context : IChecksum { /// ECMA CRC64 polynomial - public const ulong CRC64_ECMA_POLY = 0xC96C5795D7870F42; + const ulong CRC64_ECMA_POLY = 0xC96C5795D7870F42; /// ECMA CRC64 seed - public const ulong CRC64_ECMA_SEED = 0xFFFFFFFFFFFFFFFF; + const ulong CRC64_ECMA_SEED = 0xFFFFFFFFFFFFFFFF; static readonly ulong[][] _ecmaCrc64Table = { @@ -465,6 +470,7 @@ public sealed class Crc64Context : IChecksum /// Gets the hash of a file /// File path. + // ReSharper disable once ReturnTypeCanBeEnumerable.Global public static byte[] File(string filename) { File(filename, out byte[] localHash); diff --git a/FletcherContext.cs b/FletcherContext.cs index 3a44a9d..c42e3c2 100644 --- a/FletcherContext.cs +++ b/FletcherContext.cs @@ -33,6 +33,7 @@ // Disabled because the speed is abnormally slow using System; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Runtime.InteropServices; using System.Runtime.Intrinsics.Arm; @@ -46,6 +47,9 @@ namespace Aaru.Checksums; /// /// Implements the Fletcher-32 algorithm +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +[SuppressMessage("ReSharper", "UnusedMember.Global")] public sealed class Fletcher32Context : IChecksum { internal const ushort FLETCHER_MODULE = 0xFFFF; @@ -411,6 +415,9 @@ public sealed class Fletcher32Context : IChecksum /// /// Implements the Fletcher-16 algorithm +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] public sealed class Fletcher16Context : IChecksum { const byte FLETCHER_MODULE = 0xFF; diff --git a/ReedSolomon.cs b/ReedSolomon.cs index e5be6f6..8207d86 100644 --- a/ReedSolomon.cs +++ b/ReedSolomon.cs @@ -58,11 +58,14 @@ */ using System; +using System.Diagnostics.CodeAnalysis; using Aaru.Console; namespace Aaru.Checksums; /// Implements the Reed-Solomon algorithm +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "UnusedType.Global")] public class ReedSolomon { /// Alpha exponent for the first root of the generator polynomial diff --git a/SHA1Context.cs b/SHA1Context.cs index e53226f..4f7c418 100644 --- a/SHA1Context.cs +++ b/SHA1Context.cs @@ -31,6 +31,7 @@ // ****************************************************************************/ using System; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Security.Cryptography; using System.Text; @@ -40,6 +41,9 @@ namespace Aaru.Checksums; /// /// Wraps up .NET SHA1 implementation to a Init(), Update(), Final() context. +[SuppressMessage("ReSharper", "MemberCanBeInternal")] +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] public sealed class Sha1Context : IChecksum { readonly SHA1 _provider; @@ -89,6 +93,7 @@ public sealed class Sha1Context : IChecksum /// Gets the hash of a file /// File path. + // ReSharper disable once ReturnTypeCanBeEnumerable.Global public static byte[] File(string filename) { var localSha1Provider = SHA1.Create(); diff --git a/SHA256Context.cs b/SHA256Context.cs index 179e1fa..4bb6a91 100644 --- a/SHA256Context.cs +++ b/SHA256Context.cs @@ -31,6 +31,7 @@ // ****************************************************************************/ using System; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Security.Cryptography; using System.Text; @@ -40,6 +41,9 @@ namespace Aaru.Checksums; /// /// Wraps up .NET SHA256 implementation to a Init(), Update(), Final() context. +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "MemberCanBeInternal")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] public sealed class Sha256Context : IChecksum { readonly SHA256 _provider; @@ -89,6 +93,7 @@ public sealed class Sha256Context : IChecksum /// Gets the hash of a file /// File path. + // ReSharper disable once ReturnTypeCanBeEnumerable.Global public static byte[] File(string filename) { var localSha256Provider = SHA256.Create(); diff --git a/SHA384Context.cs b/SHA384Context.cs index 8ed7f37..d1bc1a4 100644 --- a/SHA384Context.cs +++ b/SHA384Context.cs @@ -31,6 +31,7 @@ // ****************************************************************************/ using System; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Security.Cryptography; using System.Text; @@ -40,6 +41,10 @@ namespace Aaru.Checksums; /// /// Wraps up .NET SHA384 implementation to a Init(), Update(), Final() context. +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +[SuppressMessage("ReSharper", "MemberCanBeInternal")] +[SuppressMessage("ReSharper", "UnusedMember.Global")] public sealed class Sha384Context : IChecksum { readonly SHA384 _provider; @@ -89,6 +94,7 @@ public sealed class Sha384Context : IChecksum /// Gets the hash of a file /// File path. + // ReSharper disable once ReturnTypeCanBeEnumerable.Global public static byte[] File(string filename) { var localSha384Provider = SHA384.Create(); diff --git a/SHA512Context.cs b/SHA512Context.cs index 4157f3c..5ca05fb 100644 --- a/SHA512Context.cs +++ b/SHA512Context.cs @@ -31,6 +31,7 @@ // ****************************************************************************/ using System; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Security.Cryptography; using System.Text; @@ -40,6 +41,10 @@ namespace Aaru.Checksums; /// /// Wraps up .NET SHA512 implementation to a Init(), Update(), Final() context. +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +[SuppressMessage("ReSharper", "MemberCanBeInternal")] +[SuppressMessage("ReSharper", "UnusedMember.Global")] public sealed class Sha512Context : IChecksum { readonly SHA512 _provider; diff --git a/SpamSumContext.cs b/SpamSumContext.cs index 2da5e03..8bde1fd 100644 --- a/SpamSumContext.cs +++ b/SpamSumContext.cs @@ -40,6 +40,7 @@ // http://ssdeep.sf.net/ using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Text; using Aaru.CommonTypes.Interfaces; @@ -48,6 +49,11 @@ namespace Aaru.Checksums; /// /// Implements the SpamSum fuzzy hashing algorithm. +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "UnusedParameter.Global")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +[SuppressMessage("ReSharper", "MemberCanBeInternal")] +[SuppressMessage("ReSharper", "OutParameterValueIsAlwaysDiscarded.Global")] public sealed class SpamSumContext : IChecksum { const uint ROLLING_WINDOW = 7;