Skip to content

Commit 6cfc820

Browse files
committed
Рефакторинг
1 parent 29db1e4 commit 6cfc820

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

MathCore/Extensions/String/StringExtensions.CRC.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#nullable enable
2-
using System.Runtime.CompilerServices;
32
using System.Text;
3+
44
using MathCore.Hash.CRC;
55

66
namespace System;
@@ -11,14 +11,12 @@ public static partial class StringExtensions
1111
/// <param name="text">Исходная строка</param>
1212
/// <param name="encoding">Кодировка</param>
1313
/// <returns>Массив байт с хешем</returns>
14-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
1514
public static byte[] ComputeSHA256(this string text, Encoding? encoding = null) => (encoding ?? Encoding.Default).GetBytes(text).ComputeSHA256();
1615

1716
/// <summary>Вычисляет MD5-хеш строки</summary>
1817
/// <param name="text">Исходная строка</param>
1918
/// <param name="encoding">Кодировка</param>
2019
/// <returns>Массив байт с хешем</returns>
21-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
2220
public static byte[] ComputeMD5(this string text, Encoding? encoding = null) => (encoding ?? Encoding.Default).GetBytes(text).ComputeMD5();
2321

2422
/// <summary>Вычисляет CRC-8 строки</summary>
@@ -30,7 +28,6 @@ public static partial class StringExtensions
3028
/// <param name="RefOut">Отражение выходного значения</param>
3129
/// <param name="XOROut">Значение для XOR с окончательным CRC</param>
3230
/// <returns>Вычисленное значение CRC-8</returns>
33-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
3431
public static byte ComputeCRC8(
3532
this string text,
3633
Encoding? encoding = null,
@@ -50,7 +47,6 @@ public static byte ComputeCRC8(
5047
/// <param name="RefOut">Отражение выходного значения</param>
5148
/// <param name="XOROut">Значение для XOR с окончательным CRC</param>
5249
/// <returns>Вычисленное значение CRC-16</returns>
53-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
5450
public static ushort ComputeCRC16(
5551
this string text,
5652
Encoding? encoding = null,
@@ -70,7 +66,6 @@ public static ushort ComputeCRC16(
7066
/// <param name="RefOut">Отражение выходного значения</param>
7167
/// <param name="XOROut">Значение для XOR с окончательным CRC</param>
7268
/// <returns>Вычисленное значение CRC-32</returns>
73-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
7469
public static uint ComputeCRC32(
7570
this string text,
7671
Encoding? encoding = null,
@@ -90,7 +85,6 @@ public static uint ComputeCRC32(
9085
/// <param name="RefOut">Отражение выходного значения</param>
9186
/// <param name="XOROut">Значение для XOR с окончательным CRC</param>
9287
/// <returns>Вычисленное значение CRC-64</returns>
93-
[MethodImpl(MethodImplOptions.AggressiveInlining)]
9488
public static ulong ComputeCRC64(
9589
this string text,
9690
Encoding? encoding = null,

0 commit comments

Comments
 (0)