Files
602_WGJ/JinYuan.Helper/ConvertHelper.cs
T

19 lines
529 B
C#
Raw Normal View History

2025-07-31 11:18:43 +08:00
using System.Linq;
2025-07-16 18:08:40 +08:00
namespace JinYuan.Helper
{
2025-07-31 11:18:43 +08:00
public static class ConvertHelper
2025-07-16 18:08:40 +08:00
{
/// <summary>
/// 字节数组高低位转换
/// </summary>
/// <param name="Arrbyte"></param>
/// <returns></returns>
public static byte[] ByteReverse(this byte[] Arrbyte)
{
byte[] ArrByte = Arrbyte.Select((x, i) => new { x, i }).GroupBy(x => x.i / 2).SelectMany(x => new byte[] { x.Last().x, x.First().x }).ToArray();
return ArrByte;
}
}
}