Move to file scoped namespaces.

This commit is contained in:
2022-03-06 13:29:37 +00:00
parent a49c5e2a2d
commit 4a18a4efd8
20 changed files with 5475 additions and 5495 deletions

View File

@@ -48,8 +48,8 @@
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace Aaru.Checksums.Adler32
{
namespace Aaru.Checksums.Adler32;
internal static class neon
{
internal static void Step(ref ushort preSum1, ref ushort preSum2, byte[] buf, uint len)
@@ -221,4 +221,3 @@ namespace Aaru.Checksums.Adler32
preSum2 = (ushort)(s2 & 0xFFFF);
}
}
}

View File

@@ -49,8 +49,8 @@ using System;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
namespace Aaru.Checksums.Adler32
{
namespace Aaru.Checksums.Adler32;
internal static class Ssse3
{
internal static void Step(ref ushort sum1, ref ushort sum2, byte[] buf, uint len)
@@ -189,4 +189,3 @@ namespace Aaru.Checksums.Adler32
sum2 = (ushort)(s2 & 0xFFFF);
}
}
}

View File

@@ -46,8 +46,8 @@ using Aaru.CommonTypes.Interfaces;
using Aaru.Helpers;
using Ssse3 = System.Runtime.Intrinsics.X86.Ssse3;
namespace Aaru.Checksums
{
namespace Aaru.Checksums;
/// <inheritdoc />
/// <summary>Implements the Adler-32 algorithm</summary>
public sealed class Adler32Context : IChecksum
@@ -406,4 +406,3 @@ namespace Aaru.Checksums
/// <param name="hash">Byte array of the hash value.</param>
public static string Data(byte[] data, out byte[] hash) => Data(data, (uint)data.Length, out hash);
}
}

View File

@@ -36,8 +36,8 @@ using System.Collections.Generic;
using Aaru.Console;
using Aaru.Helpers;
namespace Aaru.Checksums
{
namespace Aaru.Checksums;
/// <summary>Implements ReedSolomon and CRC32 algorithms as used by CD-ROM</summary>
public static class CdChecksums
{
@@ -645,4 +645,3 @@ namespace Aaru.Checksums
return false;
}
}
}

View File

@@ -30,8 +30,8 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Checksums
{
namespace Aaru.Checksums;
/// <inheritdoc />
/// <summary>Implements the CRC16 algorithm with CCITT polynomial and seed</summary>
public sealed class CRC16CCITTContext : Crc16Context
@@ -264,4 +264,3 @@ namespace Aaru.Checksums
public static ushort Calculate(byte[] buffer) =>
Calculate(buffer, CRC16_CCITT_POLY, CRC16_CCITT_SEED, _ccittCrc16Table, true);
}
}

View File

@@ -37,8 +37,8 @@ using System.Text;
using Aaru.CommonTypes.Interfaces;
using Aaru.Helpers;
namespace Aaru.Checksums
{
namespace Aaru.Checksums;
/// <inheritdoc />
/// <summary>Implements a CRC16 algorithm</summary>
public class Crc16Context : IChecksum
@@ -618,4 +618,3 @@ namespace Aaru.Checksums
return localHashInt;
}
}
}

View File

@@ -30,8 +30,8 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.Checksums
{
namespace Aaru.Checksums;
/// <inheritdoc />
/// <summary>Implements the CRC16 algorithm with IBM polynomial and seed</summary>
public sealed class CRC16IBMContext : Crc16Context
@@ -258,4 +258,3 @@ namespace Aaru.Checksums
/// <param name="hash">Byte array of the hash value.</param>
public static string Data(byte[] data, out byte[] hash) => Data(data, (uint)data.Length, out hash);
}
}

View File

@@ -48,8 +48,8 @@
using System;
using System.Runtime.Intrinsics.Arm;
namespace Aaru.Checksums.CRC32
{
namespace Aaru.Checksums.CRC32;
internal static class ArmSimd
{
internal static uint Step64(byte[] buf, long len, uint crc)
@@ -136,4 +136,3 @@ namespace Aaru.Checksums.CRC32
return c;
}
}
}

View File

@@ -52,8 +52,8 @@ using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
namespace Aaru.Checksums.CRC32
{
namespace Aaru.Checksums.CRC32;
internal static class Clmul
{
static readonly uint[] _crcK =
@@ -247,4 +247,3 @@ namespace Aaru.Checksums.CRC32
return ~Sse41.Extract(xmmCRC3, 2);
}
}
}

View File

@@ -40,8 +40,8 @@ using Aaru.Checksums.CRC32;
using Aaru.CommonTypes.Interfaces;
using Aaru.Helpers;
namespace Aaru.Checksums
{
namespace Aaru.Checksums;
/// <inheritdoc />
/// <summary>Implements a CRC32 algorithm</summary>
public sealed class Crc32Context : IChecksum
@@ -661,4 +661,3 @@ namespace Aaru.Checksums
/// <param name="hash">Byte array of the hash value.</param>
public static string Data(byte[] data, out byte[] hash) => Data(data, (uint)data.Length, out hash);
}
}

View File

@@ -38,8 +38,8 @@ using System.Text;
using Aaru.CommonTypes.Interfaces;
using Aaru.Helpers;
namespace Aaru.Checksums
{
namespace Aaru.Checksums;
/// <inheritdoc />
/// <summary>Implements a CRC64 algorithm</summary>
public sealed class Crc64Context : IChecksum
@@ -580,4 +580,3 @@ namespace Aaru.Checksums
/// <param name="hash">Byte array of the hash value.</param>
public static string Data(byte[] data, out byte[] hash) => Data(data, (uint)data.Length, out hash);
}
}

View File

@@ -39,8 +39,8 @@ using System.Text;
using Aaru.CommonTypes.Interfaces;
using Aaru.Helpers;
namespace Aaru.Checksums
{
namespace Aaru.Checksums;
/// <summary>Implements the Fletcher-32 algorithm</summary>
public sealed class Fletcher32Context : IChecksum
{
@@ -712,4 +712,3 @@ namespace Aaru.Checksums
/// <param name="hash">Byte array of the hash value.</param>
public static string Data(byte[] data, out byte[] hash) => Data(data, (uint)data.Length, out hash);
}
}

View File

@@ -36,8 +36,8 @@ using System.Security.Cryptography;
using System.Text;
using Aaru.CommonTypes.Interfaces;
namespace Aaru.Checksums
{
namespace Aaru.Checksums;
/// <summary>Wraps up .NET MD5 implementation to a Init(), Update(), Final() context.</summary>
public sealed class Md5Context : IChecksum
{
@@ -130,4 +130,3 @@ namespace Aaru.Checksums
/// <param name="hash">Byte array of the hash value.</param>
public static string Data(byte[] data, out byte[] hash) => Data(data, (uint)data.Length, out hash);
}
}

View File

@@ -32,8 +32,8 @@
using System.Runtime.InteropServices;
namespace Aaru.Checksums
{
namespace Aaru.Checksums;
public static class Native
{
static bool _checked;
@@ -80,4 +80,3 @@ namespace Aaru.Checksums
[DllImport("libAaru.Checksums.Native", SetLastError = true)]
static extern ulong get_acn_version();
}
}

View File

@@ -60,8 +60,8 @@
using System;
using Aaru.Console;
namespace Aaru.Checksums
{
namespace Aaru.Checksums;
/// <summary>Implements the Reed-Solomon algorithm</summary>
public class ReedSolomon
{
@@ -727,4 +727,3 @@ namespace Aaru.Checksums
return count;
}
}
}

View File

@@ -36,8 +36,8 @@ using System.Security.Cryptography;
using System.Text;
using Aaru.CommonTypes.Interfaces;
namespace Aaru.Checksums
{
namespace Aaru.Checksums;
/// <inheritdoc />
/// <summary>Wraps up .NET SHA1 implementation to a Init(), Update(), Final() context.</summary>
public sealed class Sha1Context : IChecksum
@@ -131,4 +131,3 @@ namespace Aaru.Checksums
/// <param name="hash">Byte array of the hash value.</param>
public static string Data(byte[] data, out byte[] hash) => Data(data, (uint)data.Length, out hash);
}
}

View File

@@ -36,8 +36,8 @@ using System.Security.Cryptography;
using System.Text;
using Aaru.CommonTypes.Interfaces;
namespace Aaru.Checksums
{
namespace Aaru.Checksums;
/// <inheritdoc />
/// <summary>Wraps up .NET SHA256 implementation to a Init(), Update(), Final() context.</summary>
public sealed class Sha256Context : IChecksum
@@ -131,4 +131,3 @@ namespace Aaru.Checksums
/// <param name="hash">Byte array of the hash value.</param>
public static string Data(byte[] data, out byte[] hash) => Data(data, (uint)data.Length, out hash);
}
}

View File

@@ -36,8 +36,8 @@ using System.Security.Cryptography;
using System.Text;
using Aaru.CommonTypes.Interfaces;
namespace Aaru.Checksums
{
namespace Aaru.Checksums;
/// <inheritdoc />
/// <summary>Wraps up .NET SHA384 implementation to a Init(), Update(), Final() context.</summary>
public sealed class Sha384Context : IChecksum
@@ -131,4 +131,3 @@ namespace Aaru.Checksums
/// <param name="hash">Byte array of the hash value.</param>
public static string Data(byte[] data, out byte[] hash) => Data(data, (uint)data.Length, out hash);
}
}

View File

@@ -36,8 +36,8 @@ using System.Security.Cryptography;
using System.Text;
using Aaru.CommonTypes.Interfaces;
namespace Aaru.Checksums
{
namespace Aaru.Checksums;
/// <inheritdoc />
/// <summary>Wraps up .NET SHA512 implementation to a Init(), Update(), Final() context.</summary>
public sealed class Sha512Context : IChecksum
@@ -131,4 +131,3 @@ namespace Aaru.Checksums
/// <param name="hash">Byte array of the hash value.</param>
public static string Data(byte[] data, out byte[] hash) => Data(data, (uint)data.Length, out hash);
}
}

View File

@@ -44,8 +44,8 @@ using System.Runtime.CompilerServices;
using System.Text;
using Aaru.CommonTypes.Interfaces;
namespace Aaru.Checksums
{
namespace Aaru.Checksums;
/// <inheritdoc />
/// <summary>Implements the SpamSum fuzzy hashing algorithm.</summary>
public sealed class SpamSumContext : IChecksum
@@ -524,4 +524,3 @@ namespace Aaru.Checksums
public RollState Roll;
}
}
}